Logging Section
Last updated
Last updated
name
string
name sink
pattern
string
useful information to save in the log
filepath
string
file to save the log
console.output_enabled
bool
display log in console
level
unsigned int
level log
trace_updates.interval
uint16_t
interval to display the log
type
string
log type (daily, rotation)
daily.max_size
uint16_t
maximum size for file type daily
daily.time
uint16_t
time of the day when a new log file will be created.
daily.truncate
bool
truncate file
rotation.max_size
uint16_t
maximum size for file type rotation
rotation.max_files
uint16_t
maximum files
TRACE
0
DEBUG
1
INFO
2
WARN
3
ERROR
4
CRITICAL
5
OFF
6
daily
rotation
Allows customizing log message formatting using a pattern. This pattern can be configured in a infinity.conf
, for example:
Each marker in the pattern has a specific meaning:
%Y
– Year with four digits (e.g., 2024
)
%m
– Month with two digits (01
to 12
)
%d
– Day of the month (01
to 31
)
%H
– Hour in 24-hour format (00
to 23
)
%M
– Minutes (00
to 59
)
%S
– Seconds (00
to 59
)
%n
– Logger name
%^
– Start of color formatting for the log level
%l
– Log level (e.g., info
, error
, debug
)
%$
– End of color formatting
%v
– Log message
If the pattern is [%Y-%m-%d %H:%M:%S] [%n] [%^%l%$] %v
and the application generates a log, it may appear as:
You can modify the pattern as needed. For example, to add milliseconds and the thread ID:
Where:
%e
– Milliseconds (000
to 999
)
%t
– Current thread ID
This could result in a log like: