kocolosk opened a new issue #1373: Structured logging
URL: https://github.com/apache/couchdb/issues/1373
 
 
   I’d like to change the way we generate and format log messages inside 
CouchDB. Currently we use “printf” style invocations of the form 
`couch_log:Level(Format, Args)` where `Level` is one of the standard syslog 
levels. In production I find that this approach makes it rather difficult to 
quickly find log messages that match some criterion. We have multi-line 
messages, individual values in messages aren’t always labeled, etc. I’ll 
sometimes end up grep'ing for a bit of text that I know to be unique for a 
particular message type, but … really? We can do better.
   
   The idea behind structured logging is that the application sends along a set 
of key-value pairs as an entry to the logging framework. The logger can then 
invoke one or more handlers to generate different message formats. A dev 
handler might write out the key-value pairs in a readable key=value format, 
while in production you might turn on a handler that produces newline-delimited 
JSON messages which can be easily consumed by any decent logging solution.
   
   I plan to take a pass at converting our existing logging invocations to a 
more structured format, then see about making the `couch_log` framework less 
printf-focused in its handler API interface. Comments and ideas welcome.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to