liveBook · Manning

Logging configuration

As explained in Troubleshooting Java, Second Edition

Logging configuration is a set of settings that determines which messages are recorded and how and where they are written.

Logging configuration determines which messages an application records, their severity threshold, and how and where those messages are written. It helps developers collect enough detail to investigate a problem without overwhelming the logs or harming maintainability. section 4.2.2

A Log4j configuration connects three components:

  • The logger selects messages, such as messages from a package or messages at or above a configured severity. section 4.2.2

Enable finer-grained investigation

With the root logger set to info, an extractor records its start and result but omits debug messages for each parsed character. Changing the root level to debug adds those character-level observations without recompiling the application. Do not confuse this level with the status attribute on Configuration: level controls application messages, while status reports Log4j's own events. section 4.2.2

How Troubleshooting Java, Second Edition covers it

How deep it goes
Explains logger, appender, formatter, severity levels, and XML settings, but stops short of broader framework internals.
Examples
Uses a Java digit extractor, Log4j XML, console output, and info-versus-debug log listings.
What you can do after
Configure Log4j to filter severity, write to the console, format entries, and enable debug detail for investigation.
How it connects
Connects logging levels with loggers, appenders, formatters, and logging frameworks.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.