4 ms·
I wouldn't put too emphasis on the plain text — we started logging back when carrying everything via JSON would've been going against the grain. These days it m
by brandur 7y ago
I wouldn't put too emphasis on the plain text — we started logging back when carrying everything via JSON would've been going against the grain. These days it might've gone the other way (I'm not sure).
One point that I'd try to convey is that the canonical line technique works for any kind of structured format. We use logfmt in all our examples, but JSON would work just as well.
- spearo77 7y agoI searched for logfmt and found your website – https://brandur.org/logfmt https://brandur.org/logfmt What I can't find described for logfmt is how to handle escaping special characters in the keys or values. Specifically the quotes and equals. JSON defines this very well, but Splunk simple key=value logging formats suffer from escaping and parsing problems.
- mirekrusin 7y agoYou could use yaml serialiser, which leaves non special strings as is and quotes special ones. But this approach can break naive grepping.