Documentation
¶
Index ¶
- type Config
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) DPanic(msg string, fields ...zap.Field)
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Fatal(msg string, fields ...zap.Field)
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) Panic(msg string, fields ...zap.Field)
- func (l *Logger) Warn(msg string, fields ...zap.Field)
- type LokiConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// 是否启用控制台日志输出
EnableConsole bool
// 是否启用文件日志输出
EnableFile bool
// 是否启用Loki输出
EnableLoki bool
// 控制台输出的最小日志级别
ConsoleLevel zapcore.Level
// 文件输出的最小日志级别
FileLevel zapcore.Level
// loki输出的最小日志级别
LokiLevel zapcore.Level
// 是否记录调用方信息
EnableCaller bool
// 日志文件路径
FilePath string
// 日志文件最大大小(MB)
MaxSize int
// 保留旧文件的最大个数
MaxBackups int
// 保留旧文件的最大天数
MaxAge int
// 是否压缩旧文件
Compress bool
// Loki配置
LokiConfig LokiConfig
}
Config 定义了日志配置
Click to show internal directories.
Click to hide internal directories.