Log
Configures how the application should log during operation.
-
YAML
-
JSON
logging:
access:
console: false
path: access.log
main:
level: debug
format: json
audit:
enabled: true
console: false
path: audit.log
{
"logging": {
"access": {
"console": false,
"path": "access.log"
},
"main": {
"level": "debug",
"format": "json"
},
"audit": {
"enabled": true,
"console": false,
"path": "audit.log"
}
}
}
Main Logs
Configures application log messages.
These log messages output in a structured log format, either with Key=Value attributes in plain (text) mode or as JSON. In either mode attributes are available driven by the HTTP request that is being processed. We try to avoid plain mode logs being overly verbose for readability, which means if you want all the attributes you’ll need to explicitly enable them. In JSON mode we assume you’re ingesting them into a system that handles formatting so include more attributes by default.
| In order to avoid logging secrets you need to specify the headers to log. If you’re including auth information via the URL (not recommended) you should make sure Request is false to avoid logging those. |
Level controls the verbosity of logs. There is no guarantee as to the specific log messages that will be outputted so you might see more or fewer log messages between versions of the application, especially at higher verbosity levels. Here are the general rules of what to expect for each level (from least to most verbose):
error-
Only messages for things that are definitely a problem with your setup or the application itself. It’s recommended to configure alerts/notifications for error logs and if the issue is not User Error, please open a ticket for it.
warn-
Includes messages for things that might be an issue but isn’t critical to the core functioning of the system. For example an issue talking to your configured cache will come through as a warning.
info-
Includes messages that allow you to see what’s happening in real time but without being overwhelmed with minutiae. Expect one or two log messages per request, including messages indicating requests with something unusual.
debug-
Includes messages to help understand what’s happening for a given request execution. Expect a few log messages per request. This is more than you probably want in prod but can be useful when first integrating with the system.
trace-
Includes messages for every level of the application as a request flows between layers. Expect several log messages per request, more for complex setups/layers. Very noisy but shouldn’t be a huge performance impact.
absurd-
Includes more information than you will probably ever need. In some cases this can produce thousands of messages per request and will have a substantial performance cost.
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
Whether to write application logs to standard out |
bool |
No |
true |
|
The file location to write logs to. Log rotation is not built-in, use an external tool to avoid excessive growth |
string |
No |
None |
|
The format to output application logs in. Applies to both standard out and file out. Possible values: |
string |
No |
plain |
|
The most-detailed log level that should be included. Possible values: |
string |
No |
info |
|
Whether to include any extra attributes based on request parameters (excluding explicitly requested). If auto (default) it defaults true if format is json, false otherwise |
bool |
No |
auto |
|
Headers to include as attributes in structured log messages. Attribute key will be in all lowercase. |
string[] |
No |
None |
| Configuration Parameter | Environment Variable |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Access Logs
Configures logs for incoming HTTP requests. Primarily outputs in standard Apache Access Log formats.
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
Whether to write access logs to standard out |
bool |
No |
true |
|
The file location to write logs to. Log rotation is not built-in, use an external tool to avoid excessive growth |
string |
No |
None |
|
The format to output access logs in. Applies to both standard out and file out. Possible values: |
string |
No |
combined |
| Configuration Parameter | Environment Variable |
|---|---|
|
|
|
|
|
|
Audit Logs
Configures a log containing only security relevant events. Auditing is off by default.
Two kinds of event are emitted, each identified by an event attribute:
auth_failure-
A request was rejected for an authentication or authorization reason. This covers a failed check by the configured authentication, a request for a layer the caller isn’t allowed, and a request for a tile outside the caller’s allowed geographic area. The
reasonattribute names which of these occurred. Standard request fields are always included (URI, path, protocol, IP, method, host, and user agent) and, when possible,userandtenantare included as well. config_reload-
The configuration was reloaded, which happens when hot reloading is enabled or when a watched secret rotates. The
outcomeattribute is eithersuccessorfailure, and a failure carries theerrorthat stopped it. Thereasonattribute says what triggered the reload:config_filefor a change to the configuration file,signalfor aSIGHUPreload signal,secret_rotationfor a watched secret whose value changed, andsecret_ttlfor the periodic reload a secretttlschedules.
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
Whether to emit audit events at all |
bool |
No |
false |
|
Whether to write audit events to standard out |
bool |
No |
true |
|
The file location to write audit events to. Log rotation is not built-in, use an external tool to avoid excessive growth. Required if Console is false. |
string |
No |
None |
|
The format to output audit events in. Applies to both standard out and file out. Possible values: |
string |
No |
json |
|
Headers to include as attributes on audit events. Attribute key will be in all lowercase. |
string[] |
No |
None |
| Configuration Parameter | Environment Variable |
|---|---|
|
|
|
|
|
|
|
|
|
|