concept good log message in category system administration

appears as: good log message
Operations Anti-Patterns DevOps Solutions

This is an excerpt from Manning's book Operations Anti-Patterns DevOps Solutions.

What makes a good log message

The key to a good log message is context. Every log message should be written from the perspective that it is the only log message that someone will see with regards to what’s being logged. For example, a message that says “Transaction complete” is useless. A message like this probably depends on previous messages that came before it, where the details of the transaction are to be inferred by previous log messages. But the problem is with many log messages coming in from various servers, being aggregated to a single instance, tying those things together might be problematic. Not to mention, if one of your log messages is logged at INFO, but the subsequent error message is logged at ERROR, then the preceding messages might not even get to the person reading the logs.