Logging
Last updated
Last updated
The logging configuration can be set using the logging
key in the HCL configuration file. The default configuration is:
You can customize the logging configuration by adding the following keys to the logging
block:
Key | Description |
---|---|
For example, to set the logging level to debug
, the format to pretty
, the path to /var/log/proksi
, and the rotation to daily
, you can use the following configuration:
This will then create a log file named proksi.log.<date>
in the /var/log/proksi
directory and rotate it daily.
The logging level can be set using the --log.level
flag. The default level is info
.
The logging format can be set using the --log.format
flag. The default format is json
.
The logging path can be set using the --log.path
flag. The default path is /tmp
.
If a path is provided, the logs will be written to a file in the specified path. The file name will be prefixed or named proksi.log.*
.
The logging rotation can be set using the --log.rotation
flag. The default rotation is never
.
Here are some examples of how to set the logging level, format, path, and rotation:
In this example, the logging level is set to debug
, the format is set to pretty
, the path is set to /var/log/proksi
, and the rotation is set to daily
.
Level | Description |
---|---|
Format | Description |
---|---|
Rotation | Description |
---|---|
level
The logging level (debug
, info
, warn
, error
, trace
)
access_logs_enabled
Whether to enable access logs (default: true)
error_logs_enabled
Whether to enable error logs (default: false)
format
The logging format (json
, pretty
)
path
The path to the log file (default: /tmp)
rotation
The rotation frequency (daily
, hourly
, minutely
, never
)
debug
Shows debug information
info
Shows information about the service
warn
Shows warnings
error
Shows errors
trace
Shows trace information
json
Logs in JSON format
pretty
Logs in a human-readable format
daily
Rotates the log file daily
hour
Rotates the log file hourly
minutely
Rotates the log file minutely
never
Does not rotate the log file