...
ONAP needs to strike a balance between human-readable and machine-readable logs. This means:
- The use of tab as a pipe (|) as a delimiter.
- Escaping all messages, exceptions, MDC values, Markers, etc. to replace tabs in pipe (|) in their content.
- Escaping all newlines with \n so that each entry is on one line.
...
The output of which, with MDCs, a Marker and a nested exception, with newlines added for readability looks like:
TODO: remove tab below
Code Block | ||||
---|---|---|---|---|
| ||||
org.onap.example.component1.subcomponent1.LogbackTest \t2017-08-06T16:09:03.594Z \tERROR \tHere's an error, that's usually bad \tkey1=value1, key2=value2 with space, key5=value5"with"quotes, key3=value3\nwith\nnewlines, key4=value4\twith\ttabs \tjava.lang.RuntimeException: Here's Johnny \n\tat org.onap.example.component1.subcomponent1.LogbackTest.main(LogbackTest.java:24) \nWrapped by: java.lang.RuntimeException: Little pigs, little pigs, let me come in \n\tat org.onap.example.component1.subcomponent1.LogbackTest.main(LogbackTest.java:27) \tAMarker1 \tmain |
...
Configuration archetypes can be found in the ONAP codebase. Choose according to your provider, and whether you're logging via EELF. Efforts to standardize them are underway, so the ones you should be looking for are where tab pipe (|) is used as a separator. (Previously it was "|").
...