CHAPTER 4

image

Formatting Logging Information in log4j

In the previous chapters, we discussed the core objects in the log4j API, and learned how they interact with each other to produce flexible logging messages. We saw that the initiation of a logging process starts with Logger objects. The encapsulated logging information is passed to Appender objects, and Appender objects use Layout objects to format the logging information in a human-readable way before publishing the logging information to a destination.

How logging information is structured is very important. In a real-life application, logging information constitutes more than just debugging ...

Get Pro Apache Log4j, Second Edition 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.