v0.5
BREAKING CHANGES
- new, future-proof API
- settings in
server.cfg
moved to newlog-core.yml
settings file:logcore_debuginfo 0
(disabling debug info) is nowDisableDebugInfo: true
(global setting)logtimeformat
(setting for log time format, also used by SAMP directly) is nowLogTimeFormat
(global setting)
Logger configuration now takes place in a central file named log-config.yml
, located in the server root directory (alongside the server binary). The structure and features available to be configured can be taken from following example:
Logger:
plugins/mysql: # logger name
LogLevel: All
LogRotation:
Type: Size
Trigger: 10KB # supported units: KB (kilobyte), MB (megabyte), GB (gigabyte) (defaults to 100MB)
BackupCount: 15 # max backup count to keep (defaults to 10)
# LogRotation:
# Type: Date
# Trigger: Daily # supported times: Daily, Weekly, Monthly (defaults to Daily)
# BackupCount: 25
Append: false # whether to append to log file or overwrite log file on each startup (defaults to true)
PrintToConsole: true # prints log messages into the server console (defaults to false)
system/player/item:
LogLevel:
- Warning
- Error
- Fatal
LogRotation:
Type: Size
Trigger: 20MB
LogLevel: # per loglevel settings
Error:
PrintToConsole: true # prints all errors into the server console (defaults to false)
EnableColors: true # enables colors for server console output (defaults to false)
LogTimeFormat: '%y/%m/%d %H:%M:%S' # refer to https://en.cppreference.com/w/cpp/chrono/c/strftime for a list of all available specifiers (defaults to "%x %X")
#LogsRootFolder: 'custom-logs' (defaults to "logs")
#DisableDebugInfo: true (defaults to "false")