In config.json, the log
field is used to specify the logging options for the Sing-Box server. This can include the level of logging that should be performed and the location where the log files should be saved.
Here is an example of how the log
field might be used in a Sing-Box configuration file:
"log": {
"disabled": false,
"level": "error",
"output": "box.log",
"timestamp": true
}
Code language: JSON / JSON with Comments (json)
In this example, the Sing-Box server will log all error messages to the file /etc/sing-box/box.log
. The log level is set to error, meaning that only error messages and higher will be logged.
The log field is optional in a Sing-Box configuration file. If it is not included, Sing-Box will use default logging options. Customizing the logging options to suit your specific needs and requirements is possible.
You can also set the log level to any of the following:
trace
debug
info
warn
error
fatal
panic
Review other configurations for the Singbox, such as DNS settings, inbounds and outbounds, routing rules, and its experimental features.