Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLoggerFromConfig ¶
CreateLoggerFromConfig creates a logger based on viper configuration
Types ¶
type ConsoleLoggerConfig ¶
type ConsoleLoggerConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Colors bool `yaml:"colors" json:"colors"`
JsonFormat bool `yaml:"json_format" json:"json_format"`
}
ConsoleLoggerConfig contains configuration for console logging
type FileLoggerConfig ¶
type FileLoggerConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Filename string `yaml:"filename" json:"filename"`
Directory string `yaml:"directory" json:"directory"` // Directory where log files will be created
JsonFormat bool `yaml:"json_format" json:"json_format"`
MaxSize int `yaml:"max_size" json:"max_size"`
MaxBackups int `yaml:"max_backups" json:"max_backups"`
MaxAge int `yaml:"max_age" json:"max_age"`
Compress bool `yaml:"compress" json:"compress"`
}
FileLoggerConfig contains configuration for file logging with rotation
type LogConfig ¶
type LogConfig struct {
Level string `yaml:"level" json:"level"`
ConsoleLogger ConsoleLoggerConfig `yaml:"console_logger" json:"console_logger"`
FileLogger FileLoggerConfig `yaml:"file_logger" json:"file_logger"`
}
LogConfig represents the complete logger configuration Design is extensible - new logger configs can be added here
Click to show internal directories.
Click to hide internal directories.