Skip to content

What are the differences between the various prefixes in asynchronous loggers? #3817

Answered by ppkarwasz
youngledo asked this question in Q&A
Discussion options

You must be logged in to vote

That’s an excellent question — and one that gets to the heart of Log4j Core’s architecture.

To answer it properly, we need to distinguish between two key components in Log4j Core: Logger and LoggerConfig. While other logging frameworks delegate the tasks of both to a single object, Log4j treats them as distinct — and for good reason.

Logger vs LoggerConfig

  • A Logger is the object your application code interacts with — it implements the org.apache.logging.log4j.Logger interface.
    See: Architecture: Logger

  • A <Logger>, <Root>, <AsyncLogger>, or <AsyncRoot> element in your configuration file corresponds to a LoggerConfig — the component that actually defines how events are handled.
    See: Arc…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by youngledo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants