Logging frameworks and concepts
There are lots of logging frameworks and this is probably one challenge integrators have, since the more you integrate libraries, the more you will need to ensure loggers are consistent and potentially go to the same output. However, they all share the same basic concepts, which are important to understand to know how to properly use loggers and how they can impact the application performance in a bad way if you don't take care of their usages.
These concepts can be differently named depending on the framework, but to identify them, we will use the JUL names in this book:
- Logger
- Logger Factory
- LogRecord
- Handler
- Filter
- Formatter
- Level
Logger
The logger is the entry point of the logging framework. This is the instance you use to write messages. The API has, generally, a set of helper methods but the requisite API elements are:
- To allow passing a level with the message.
- To allow passing a precomputed message of what is needed to compute a message (it can be a pattern with...