Logging invocations

Before looking at how to properly integrate loggers into your application using some common patterns, let's see what a logger invocation will trigger.

A simple logger invocation, like logger.info(message) , can be inspected to be represented as equivalent to the following steps:

  • Check if the level of the logger is active; if not, exit
  • Create a log record (set the message and level, initialize the source of the log, class, method, and so on)
  • Check if the message is filtered with a Filter; if the filter filters it, then exit
  • For all handlers, publish the log record to the handler:
    • Check the level of the handler versus the log record level, if not compatible then exit (note: this check is often done multiple times; it ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.