Documentation ¶
Index ¶
- func NewConfig(logger *zap.Logger) *config
- func NewJSONFileLogger(consoleLogger *zap.Logger, fileName string, level zapcore.Level, ...) *zap.Logger
- func NewJSONLogger(output *os.File, level zapcore.Level, format LoggingFormat) *zap.Logger
- func NewMultiLogger(loggers ...*zap.Logger) *zap.Logger
- func NewRotatingJSONFileLogger(consoleLogger *zap.Logger, config Config, level zapcore.Level, ...) *zap.Logger
- func RedirectStdLog(logger *zap.Logger)
- func SetupLogging(tmpLogger *zap.Logger, config Config) (*zap.Logger, *zap.Logger)
- func StackdriverLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- type Config
- type LoggerConfig
- type LoggingFormat
- type RedirectStdLogWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfig ¶
NewConfig constructs a Config struct which represents server settings, and populates it with default values.
func NewJSONFileLogger ¶
func NewJSONLogger ¶
func RedirectStdLog ¶
func SetupLogging ¶
func StackdriverLevelEncoder ¶
func StackdriverLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
Types ¶
type Config ¶
type Config interface { GetWatch() string GetLogger() *LoggerConfig Clone() (Config, error) }
type LoggerConfig ¶
type LoggerConfig struct { Level string `yaml:"level" json:"level" usage:"Log level to set. Valid values are 'debug', 'info', 'warn', 'error'. Default 'info'."` Stdout bool `yaml:"stdout" json:"stdout" usage:"Log to standard console output (as well as to a file if set). Default true."` File string `` /* 135-byte string literal not displayed */ Rotation bool `yaml:"rotation" json:"rotation" usage:"Rotate log files. Default is false."` // Reference: https://godoc.org/gopkg.in/natefinch/lumberjack.v2 MaxSize int `` /* 139-byte string literal not displayed */ MaxAge int `` /* 195-byte string literal not displayed */ MaxBackups int `` /* 188-byte string literal not displayed */ LocalTime bool `` /* 184-byte string literal not displayed */ Compress bool `yaml:"compress" json:"compress" usage:"This determines if the rotated log files should be compressed using gzip."` Format string `yaml:"format" json:"format" usage:"Set logging output format. Can either be 'JSON' or 'Stackdriver'. Default is 'JSON'."` }
LoggerConfig is configuration relevant to logging levels and output.
func NewLoggerConfig ¶
func NewLoggerConfig() *LoggerConfig
type LoggingFormat ¶
type LoggingFormat int8
const ( JSONFormat LoggingFormat = iota - 1 StackdriverFormat )
type RedirectStdLogWriter ¶
type RedirectStdLogWriter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.