LogRecord

The LogRecord is the logging message structure. It encapsulates more data than just the String message you passed, allowing you to get the information we often see in the log messages, such as:

  • The log level
  • Optionally, a log sequence number
  • The source class name
  • The source method name
  • The message indeed
  • The thread (often identified by its identifier rather than its name but this last one is not always unique)
  • The logger invocation date (often in milliseconds as of 1970)
  • Optionally, an exception associated with the logger invocation
  • The logger name
  • Optionally, a resource bundle if the logger supports internationalization
  • Optionally, a call context such as a set of contextual data based on custom values (MDC) or the current HTTP ...

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.