Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitFromConfig ¶
InitFromConfig initializes a Logrus instance from config options.
Types ¶
type Config ¶
type Config struct { // Level specifies the minimum allowed log level. Level string `json:"logging.level" yaml:"logging.level"` // MaxAge is the maximum number of days to retain old log files based on the // timestamp encoded in their filename. MaxAge int `json:"logging.max-age" yaml:"logging.max-age"` // MaxBackups is the maximum number of old log files to retain. MaxBackups int `json:"logging.max-backups" yaml:"logging.max-backups"` // MaxSize is the maximum size in megabytes of the log file before it gets rotated. MaxSize int `json:"logging.max-size" yaml:"logging.max-size"` // Formatter represents the log formatter (json | text ). Formatter string `json:"logging.formatter" yaml:"logging.formatter"` // Path represents the alternative paths for storing the logs. Path string `json:"logging.path" yaml:"logging.path"` // LogStdout indicates whether log lines are written to standard output in addition to writing them // to log files. LogStdout bool `json:"logging.log-stdout" yaml:"logging.log-stdout"` }
Config contains a set of setting that control the behaviour of the logging system.
func (*Config) InitFromViper ¶
InitFromViper initializes logging configuration from Viper.
Click to show internal directories.
Click to hide internal directories.