Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTimeEncoder 默认时间编码器 DefaultTimeEncoder = zapcore.TimeEncoderOfLayout("2006-01-02T15:04:05.000") )
Functions ¶
Types ¶
type Config ¶
type FileOptions ¶ added in v0.2.0
type FileOptions struct {
Path string
Compress string
MaxSize int
MaxBackups int
MaxAge int
Level zapcore.Level
}
FileOptions 文件适配器选项
type HTTPOptions ¶ added in v0.2.0
type HTTPOptions struct {
URL string // HTTP URL
Timeout time.Duration // 超时时间
BufferSize int // 缓冲区大小
BatchSize int // 批量发送大小
MaxRetries int // 最大重试次数
Level zapcore.Level
}
HTTPOptions HTTP 适配器选项
type HTTPWriter ¶
type HTTPWriter struct {
// contains filtered or unexported fields
}
HTTPWriter 异步批量发送日志到 HTTP 端点
func (*HTTPWriter) Close ¶ added in v0.2.0
func (w *HTTPWriter) Close() error
Close 关闭 writer 并等待所有日志发送完成
type Logger ¶ added in v0.2.0
Logger 包装 zap.Logger,提供清理功能
func NewWithConfig ¶
NewWithConfig 根据配置创建日志实例
type Service ¶ added in v0.2.0
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.