mirror of
https://gitee.ltd/lxh/logger.git
synced 2025-10-23 14:56:16 +08:00
46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
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"`
|
|
StackLevel string `yaml:"stack_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"`
|
|
}
|