-
I saw in the document "https://logging.staged.apache.org/log4j/2.x/manual/async.html#log4j2.asyncLoggerConfigRingBufferSize" that there are two ways of writing it, differing only in the prefix, but I didn't quite understand what the actual difference between them is. ![]() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 vs LoggerConfig
This separation gives Log4j Core its powerful reconfiguration reliability: during configuration reloads, a Asynchronous Logging: Two ApproachesThis distinction between Full Asynchronous Loggers (
|
Beta Was this translation helpful? Give feedback.
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
andLoggerConfig
. 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 theorg.apache.logging.log4j.Logger
interface.See: Architecture: Logger
A
<Logger>
,<Root>
,<AsyncLogger>
, or<AsyncRoot>
element in your configuration file corresponds to aLoggerConfig
— the component that actually defines how events are handled.See: Arc…