Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Levels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERR"}
Levels are the log levels we respond to=o.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Level is the log level to use. Level string `json:"level"` // LogFilePath is the path to the file the logs get written to LogFilePath string `json:"log_file"` // LogRotateBytes is the maximum number of bytes that should be written to a log // file LogRotateBytes int `json:"log_rotate_bytes"` // LogRotateDuration is the time after which log rotation needs to be performed LogRotateDuration time.Duration `json:"log_rotate_duration"` // LogRotateMaxFiles is the maximum number of log file archives to keep LogRotateMaxFiles int `json:"log_rotate_max_files"` // Syslog and SyslogFacility are the syslog configuration options. Syslog bool `json:"syslog"` SyslogFacility string `json:"syslog_facility"` // SyslogName is the progname as it will appear in syslog output (if enabled). SyslogName string `json:"name"` // Writer is the output where logs should go. If syslog is enabled, data will // be written to writer in addition to syslog. Writer io.Writer `json:"-"` }
Config is the configuration for this log setup.
type LogFile ¶ added in v0.28.0
type LogFile struct { // LastCreated represents the creation time of the latest log LastCreated time.Time // FileInfo is the pointer to the current file being written to FileInfo *os.File // MaxBytes is the maximum number of desired bytes for a log file MaxBytes int // BytesWritten is the number of bytes written in the current log file BytesWritten int64 // Max rotated files to keep before removing them. MaxFiles int // contains filtered or unexported fields }
type SyslogWrapper ¶
type SyslogWrapper struct {
// contains filtered or unexported fields
}
SyslogWrapper is used to cleanup log messages before writing them to a Syslogger. Implements the io.Writer interface.
Click to show internal directories.
Click to hide internal directories.