mirror of
https://gitee.ltd/lxh/logger.git
synced 2025-10-23 14:56:16 +08:00
🎉logger的v2版本,暂未支持环境变量配置
This commit is contained in:
44
config.go
Normal file
44
config.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package zap_logger
|
||||
|
||||
type Config struct {
|
||||
Logger *Logger `yaml:"logger"`
|
||||
File *File `yaml:"file"`
|
||||
Console *Console `yaml:"console"`
|
||||
Loki *Loki `yaml:"loki"`
|
||||
}
|
||||
|
||||
type Logger struct {
|
||||
Encoder string `yaml:"encoder"`
|
||||
Level string `yaml:"level"`
|
||||
}
|
||||
|
||||
type File struct {
|
||||
Enable bool `yaml:"enable"`
|
||||
Encoder string `yaml:"encoder"`
|
||||
Level string `yaml:"level"`
|
||||
Filename string `yaml:"name"`
|
||||
MaxSize int `yaml:"max_size"`
|
||||
MaxAge int `yaml:"max_age"`
|
||||
MaxBackups int `yaml:"max_backups"`
|
||||
LocalTime bool `yaml:"local_time"`
|
||||
Compress bool `yaml:"compress"`
|
||||
}
|
||||
|
||||
type Console struct {
|
||||
Enable bool `yaml:"enable"`
|
||||
Encoder string `yaml:"encoder"`
|
||||
Level string `yaml:"level"`
|
||||
Color bool `yaml:"color"`
|
||||
}
|
||||
|
||||
type Loki struct {
|
||||
Enable bool `yaml:"enable"`
|
||||
Encoder string `yaml:"encoder"`
|
||||
Level string `yaml:"level"`
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
Source string `yaml:"source"`
|
||||
Service string `yaml:"service"`
|
||||
Job string `yaml:"job"`
|
||||
Environment string `yaml:"environment"`
|
||||
}
|
Reference in New Issue
Block a user