Documentation ¶
Index ¶
Constants ¶
View Source
const ( FilepathSplitter = "," DefaultFilepath = "stdout" DefaultMaxFileSize = 100 DefaultMaxBackups = 30 DefaultMaxAge = 30 DefaultCompress = true )
View Source
const ( JSONEncoding = "json" ConsoleEncoding = "console" LevelEncoderCapital = "capital" LevelEncoderCapitalColor = "capitalColor" LevelEncoderColor = "color" LevelEncoderLowercase = "lowercase" TimeEncoderRFC3339Nano = "rfc3339nano" TimeEncoderRFC3339 = "rfc3339" TimeEncoderISO8601 = "iso8601" TimeEncoderMillis = "millis" TimeEncoderNanos = "nanos" TimeEncoderSecond = "second" TimeEncoderLayout = "2006-01-02 15:04:05.000000" DurationEncoderString = "string" DurationEncoderNanos = "nanos" DurationEncoderMillis = "ms" DurationEncoderSecond = "second" CallerEncoderFull = "full" CallerEncoderShort = "short" NameEncoderFull = "full" DefaultLevel = zap.InfoLevel DefaultIsDev = false DefaultDisableCaller = false DefaultDisableStacktrace = true // stack core will extract error stack, so zap's stack is useless DefaultEncoding = ConsoleEncoding DefaultEncoderMessageKey = "msg" DefaultEncoderLevelKey = "lvl" DefaultEncoderNameKey = "logger" DefaultEncoderTimeKey = "ts" DefaultEncoderCallerKey = "caller" DefaultEncoderFunctionKey = "" DefaultEncoderStacktraceKey = "stacktrace" DefaultEncoderSkipLineEncoding = false DefaultEncoderLineEnding = "\n" DefaultEncoderLevelEncoder = LevelEncoderLowercase DefaultEncoderTimeEncoder = TimeEncoderLayout DefaultEncoderDurationEncoder = DurationEncoderString DefaultEncoderCallerEncoder = CallerEncoderShort DefaultEncoderNameEncoder = NameEncoderFull DefaultEncoderConsoleSeparator = "\t" )
Variables ¶
View Source
var ( DefaultOutputPath = []string{"stdout"} DefaultErrorOutputPath = []string{"stderr"} )
Functions ¶
func DefaultConfig ¶
func DefaultEncoderConfig ¶
func DefaultEncoderConfig() zapcore.EncoderConfig
Types ¶
type Cfg ¶
type Cfg struct { Filepath string `env:"LOG_PATH" yaml:"filepath"` Encoding string `env:"LOG_ENCODING" yaml:"encoding"` MaxFileSize int `env:"LOG_MAX_FILE_SIZE" yaml:"maxFileSize"` MaxBackups int `env:"LOG_MAX_BACKUPS" yaml:"maxBackups"` MaxAge int `env:"LOG_MAX_AGE" yaml:"maxAge"` Level zapcore.Level `env:"LOG_LEVEL" yaml:"level"` Compress bool `env:"LOG_COMPRESS" yaml:"compress"` }
Click to show internal directories.
Click to hide internal directories.