Use Structured logging
Closed this issue · 1 comments
manoranjith commented
Motivation / Context
Currently we use basic logging, the log message is simple text with the info and corresponding data, as show below:
time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes to -4"
Update the log calls so that the message is logged separately and the data is logged as key-value pair as shown below:
time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperature=-4
Description
We use logrus
library for logging. Use the WithFields
method to add key-value pairs to the log entry.
Relates to
Testing
All data in error messages are logged as key-value pairs.
Thread Safety
-NA-
manoranjith commented
Issue #132, that deals with error handling also requires the different data to be returned in a structured format as key value pairs. Hence, it would be efficient to do the rewrite of log messages with structured data when updating the error messages as part of that issue.