Logging configuration
RADIUS Proxy (RPR) writes log messages into stdout. Use the following configuration options to control RPR logging:
Log levels
These are the available RPR log levels ordered by importance:
emergencyalertcriticalerrorwarningnoticeinfodebug
Caution
The default values are set to work well in most cases. Think carefully before changing them, and consider the system's load and use case, as the values depend on both. If the log level is set to debug, you may need to increase these values to handle the higher log volume. Otherwise, it is recommended to keep them low to avoid log overload.
Log format
The format of log messages is specified in the log.console.format configuration option. It can have one of these values:
defaultjson- A string that defines a custom format
When the log.console.format configuration option is set to json, all RPR log messages are printed in the JSON format. If set to default, the log messages are printed according to the following template: $time [$level] [code=$code] [node=$node] $msg. The template may have variables prefixed with the $ symbol. When the resulting log message is printed, each variable is replaced with its corresponding runtime value.
You can pass a custom format string to specify a template for log messages. The log.console.format supports the following variable names:
$time- UTC timestamp of the log entry$level- Log level$code- Code number. For more information, see the Log message codes document.$msg- Log message$pid- Process ID, which prints the log message$node- RPR node name
For example, if you want to have logs in the logfmtOpens in a new tab format, configure RPR as follows:
This configuration prints log messages like:
Overload protection
Too many log messages may affect RPR performance and resource consumption. To prevent this, RPR provides several configuration options to control logging overload:
- logging.console.burst_limit_max_count - controls the maximum number of log messages that RPR handles within the time window defined in logging.console.burst_limit_window_time (in milliseconds). If the number of messages is bigger than this limit, additional messages are dropped until the time window resets.
- log.console.sync_mode_queue_len - defines the queue size threshold for switching to synchronous mode. By default, log messages are handled asynchronously. When the number of messages in the logger queue exceeds this value, synchronous handling is triggered. If the queue grows even further, RPR starts to drop and flush the messages. Such messages will never be printed. This behaviour is controlled by the log.console.drop_mode_queue_len and log.console.flush_queue_len configuration options. If sync_mode_queue_len equals drop_mode_queue_len, all the messages are handled asynchronously.
To ensure the overload protection mechanism works as expected, make sure the following condition is met:
For more information, read the official Erlang logger documentationOpens in a new tab.
If you experience issues with logging, such as performance degradation due to the high number of logs, refer to the Preventing logs overload document. It provides instructions on how to adjust the logging level and change the configuration for logging overload at runtime.
Note
Some of the log messages may contain the code tag with the code number that describes an error or warning. For more information, see the Log message codes document.