Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TextLogType defines a TextFormatter logger. TextLogType = "text" // JSONLogType defines a JSONFormatter logger. JSONLogType = "json" )
View Source
const ( // DefaultTimestampFormat defines the default time format of the timestamps. DefaultTimestampFormat = "2006-01-02 15:04:05" // DefaultLogFilename defines the default name of the log file. DefaultLogFilename = "log.log" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureDefault ¶
func ConfigureDefault()
ConfigureDefault configures the logging with the default values.
Types ¶
type Config ¶
type Config struct {
DefaultLogger *LogConfig `json:"defaultLogger" binding:"optional"`
}
Config denotes the configuration of the logging.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns a default logging configuration.
type LogConfig ¶
type LogConfig struct { Type string `json:"type" binding:"required"` TimestampFormat string `json:"timestampFormat" binding:"optional"` DisableFullTimestamp bool `json:"disableFullTimestamp" binding:"optional"` DisableColors bool `json:"disableColors" binding:"optional"` EnableFunctionNameLogging bool `json:"enabledFunctionNameLogging" binding:"optional"` LogFile *LogFileConfig `json:"logFile" binding:"optional"` }
LogConfig denotes the configuration of the loggers.
type LogFileConfig ¶
type LogFileConfig struct { Path string `json:"path" binding:"required"` Filename string `json:"filename" binding:"required"` }
LogFileConfig denotes the configuration of the log file.
Click to show internal directories.
Click to hide internal directories.