3 ms·
I too thought that his logging recommendations were weak. Simply logging an error (even with context) doesn't tell you much about how you entered that state. I
by allengeorge 11y ago
I too thought that his logging recommendations were weak. Simply logging an error (even with context) doesn't tell you much about how you entered that state.
I follow these guidelines (similar to yours):
- ERROR: Failed assertions, unrecoverable conditions
- WARN: Exceptions (request is toast, but system works)
- INFO: Important actions (entered a certain state)
- DEBUG: Information associated with the actions above
Note that we too don't log full requests, etc. at DEBUG - that's way, way too much. If you really want to do that? TRACE, but that's usually important for the developers of those libraries. We're also lucky in that we use logback, so we can change the log level of the system at runtime very easily.
In production we usually run on INFO and above and the logs aren't overwhelming - though we're constantly trying to improve the quality and consistency of the messages.