Add 'json_pretty_print' logging format
- Remove
exception_string
from context array since the exception is now being fully normalized - Setting the following config value in will result logging being formatted with the JSON_PRETTY_PRINT option.
process.pool.logger.formatter.log_format: 'json_pretty_print'
This is useful to bypass docker logging driver line limits of 16KB since each new line is passed as its own record.
In practice, log messages go from looking like:
{"time":"Mon,06May1921:12:17.760256UTC","level":"notice","process_id":"78","process_path":"\/server[16]\/root[20]\/job[78]","message":"working","context":{"job_type":"complex_logging_structure","event_type":"working"},"context_json_last_error":0}
to looking like
{
"time": "Mon, 06 May 19 21:12:17.760256 UTC",
"level": "notice",
"process_id": "78",
"process_path": "\/server[16]\/root[20]\/job[78]",
"message": "working",
"context": {
"job_type": "complex_logging_structure",
"event_type": "working"
},
"context_json_last_error": 0
}