Documentation ¶
Index ¶
- func InitFileLogger(logger *log.Logger, logConf *LogConfig) error
- func InitStandardFileLogger(logConf *LogConfig) error
- func LogFlags(logConf *LogConfig) []cli.Flag
- func Logger() *log.Entry
- func LoggerForJob(jobID string) *log.Entry
- func LoggerForRequest(ctx *RequestContext) *log.Entry
- func LoggerForRun(runID string) *log.Entry
- type Formatter
- type LogConfig
- type RequestContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitFileLogger ¶
* InitFileLogger - initialize file logger * PARAMS: * - logger: *log.Logger * - logConf: config of log * RETURNS: * nil, if succeed * error, if fail
func InitStandardFileLogger ¶
* InitStandardFileLogger - initialize standard logger for file record * PARAMS: * - logConf: config of log * RETURNS: * nil, if succeed * error, if fail
func LoggerForJob ¶
func LoggerForRequest ¶
func LoggerForRequest(ctx *RequestContext) *log.Entry
func LoggerForRun ¶
Types ¶
type Formatter ¶
type Formatter struct { // Timestamp format TimestampFormat string // Available standard keys: time, msg, lvl // Also can include custom fields but limited to strings. // All of fields need to be wrapped inside %% i.e %time% %msg% LogFormat string }
Formatter implements logrus.Formatter interface.
type LogConfig ¶
type LogConfig struct { Dir string `yaml:"dir"` FilePrefix string `yaml:"filePrefix"` Level string `yaml:"level"` MaxKeepDays int `yaml:"maxKeepDays"` MaxFileNum int `yaml:"maxFileNum"` MaxFileSizeInMB int `yaml:"maxFileSizeInMB"` IsCompress bool `yaml:"isCompress"` Formatter string `yaml:"formatter"` }
Click to show internal directories.
Click to hide internal directories.