Rotate
This package implements the gen.LoggerBehavior
interface and provides the capability to log messages to a file, with support for log file rotation at a specified interval.
Available options
Period
Specifies the rotation period (minimum value:time.Minute
)TimeFormat
Sets the format for the timestamp in log messages. You can choose any existing format (see time package) or define your own. By default, timestamps are in nanosecondsIncludeBehavior
includes the process behavior in the logIncludeName
includes the registered process nameShortLevelName
enables shortnames for the log levelsPath
directory for the log files, default:./log
Prefix
defines the log files name prefix (<Path>/<Prefix>.YYYYMMDDHHMi.log[.gz]
)Compress
Enables gzip compression for log filesDepth
Specifies the number of log files in rotation
Example
Last updated