Clio provides several logging options, which all are configurable via the config file. These are detailed in the following sections.
The minimum level of severity at which the log message will be outputted by default. Severity options are trace
, debug
, info
, warning
, error
, fatal
. Defaults to info
.
The format of log lines produced by Clio. Defaults to "%TimeStamp% (%SourceLocation%) [%ThreadID%] %Channel%:%Severity% %Message%"
.
Each of the variables expands like so:
TimeStamp
: The full date and time of the log entrySourceLocation
: A partial path to the c++ file and the line number in said file (source/file/path:linenumber
)ThreadID
: The ID of the thread the log entry is written fromChannel
: The channel that this log entry was sent toSeverity
: The severity (aka log level) the entry was sent atMessage
: The actual log message
An array of JSON objects, each overriding properties for a logging channel
.
Important
At the time of writing, only log_level
can be overridden using this mechanism.
Each object is of this format:
{
"channel": "Backend",
"log_level": "fatal"
}
If no override is present for a given channel, that channel will log at the severity specified by the global log_level
.
The log channels that can be overridden are: Backend
, WebServer
, Subscriptions
, RPC
, ETL
and Performance
.
Note
See example-config.json for more details.
Enable or disable log output to console. Options are true
/false
. This option defaults to true
.
Path to the directory where log files are stored. If such directory doesn't exist, Clio will create it.
If the option is not specified, the logs are not written to a file.
The max size of the log file in megabytes before it will rotate into a smaller file. Defaults to 2GB.
The max size of the log directory in megabytes before old log files will be deleted to free up space. Defaults to 50GB.
The time interval in hours after the last log rotation to automatically rotate the current log file. Defaults to 12 hours.
Note
Log rotation based on time occurs in conjunction with size-based log rotation. For example, if a size-based log rotation occurs, the timer for the time-based rotation will reset.
Tag implementation to use. Must be one of:
uint
: Lock free and threadsafe but outputs just a simple unsigned integeruuid
: Threadsafe and outputs a UUID tagnone
: Doesn't use tagging at all