log: level: info format: json output: stderr rotation: maxSize: 100 maxAge: 10 maxBackups: 3 localTime: false compress: false
The supported levels are:
fatal- The program will exit when this level of logging is output.
error- General errors, the program runs normally.
warn- warnings that you should be noticed.
info- general infos.
debug- Output more information than
infolevel, used to locate problems during development or use.
trace- More information than
debuglevel output, useful for development debugging.
The default level is
debug level can be set through the
-D parameter on the command line, or the corresponding level can be set through the environment variable
The log supports
text formats, the default is
The supported output methods are:
none- Discard the log without outputting any information.
stderr- standard error stream.
stdout- Standard output stream.
/path/to/file- The specified file path.
Defaults to output to the standard error stream (
Logs can be split, backed up and compressed by configuring the
rotation option. Valid when
output is a file.
- The maximum size in megabytes of the log file before it gets rotated. It defaults to 100 megabytes.
- The maximum number of days to retain old log files based on the timestamp encoded in their filename. Note that a day is defined as 24 hours and may not exactly correspond to calendar days due to daylight savings, leap seconds, etc. The default is not to remove old log files based on age.
- the maximum number of old log files to retain. The default is to retain all old log files (though
maxAgemay still cause them to get deleted.)
- Determines if the time used for formatting the timestamps in backup files is the computer's local time. The default is to use UTC time.
- Determines if the rotated log files should be compressed using gzip. The default is not to perform compression.