@@ -30,13 +30,13 @@ created it will be associated with the LoggerConfig that contains either
30
30
a) the same name as the Logger, b) the name of a parent package, or c)
31
31
the root LoggerConfig. LoggerConfig objects are created from Logger
32
32
declarations in the configuration. The LoggerConfig is associated with
33
- the Appenders that actually deliver the LogEvents.
33
+ the Appenders that deliver the LogEvents.
34
34
35
35
[id=logger-hierarchy]
36
36
=== Logger Hierarchy
37
37
38
38
The first and foremost advantage of any logging API over plain
39
- `System.out.println` resides in its ability to disable certain log
39
+ `System.out.println() ` resides in its ability to disable certain log
40
40
statements while allowing others to print unhindered. This capability
41
41
assumes that the logging space, that is, the space of all possible
42
42
logging statements, is categorized according to some developer-chosen
@@ -99,8 +99,8 @@ xref:manual/logsep.adoc[Log Separation] section.
99
99
Every LoggerContext has an active
100
100
link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/Configuration.html[`Configuration`].
101
101
The Configuration contains all the Appenders, context-wide Filters,
102
- LoggerConfigs and contains the reference to the StrSubstitutor. During
103
- reconfiguration two Configuration objects will exist. Once all Loggers
102
+ LoggerConfigs and contains the reference to the StrSubstitutor.
103
+ During reconfiguration, two Configuration objects will exist. Once all Loggers
104
104
have been redirected to the new Configuration, the old Configuration
105
105
will be stopped and discarded.
106
106
@@ -118,7 +118,7 @@ causing their behavior to be modified.
118
118
Retrieving Loggers
119
119
120
120
Calling the `LogManager.getLogger` method with the same name will always
121
- return a reference to the exact same Logger object.
121
+ return a reference to the same Logger object.
122
122
123
123
For example, in
124
124
@@ -230,7 +230,7 @@ In example 3, the loggers`root`, `X` and `X.Y.Z` each have a configured
230
230
LoggerConfig with the same name. The Logger `X.Y` does not have a
231
231
configured LoggerConfig with a matching name so uses the configuration
232
232
of LoggerConfig `X` since that is the LoggerConfig whose name has the
233
- longest match to the start of the Logger's name.
233
+ the longest match to the start of the Logger's name.
234
234
235
235
.Example 4
236
236
[cols=",,,",options="header",]
@@ -245,7 +245,7 @@ longest match to the start of the Logger's name.
245
245
In example 4, the loggers `root` and `X` each have a Configured
246
246
LoggerConfig with the same name. The loggers `X.Y` and `X.Y.Z` do not
247
247
have configured LoggerConfigs and so get their Level from the
248
- LoggerConfig assigned to them,`X`, since it is the LoggerConfig whose
248
+ LoggerConfig assigned to them, `X`, since it is the LoggerConfig whose
249
249
name has the longest match to the start of the Logger's name.
250
250
251
251
.Example 5
@@ -258,10 +258,10 @@ name has the longest match to the start of the Logger's name.
258
258
|X.YZ |X |ERROR |ERROR
259
259
|=============================================================
260
260
261
- In example 5, the loggers`root`.`X`, and `X.Y` each have a Configured
261
+ In example 5, the loggers `root`.`X`, and `X.Y` each has a configured
262
262
LoggerConfig with the same name. The logger `X.YZ` does not have
263
263
configured LoggerConfig and so gets its Level from the LoggerConfig
264
- assigned to it,`X`, since it is the LoggerConfig whose name has the
264
+ assigned to it, `X`, since it is the LoggerConfig whose name has the
265
265
longest match to the start of the Logger's name. It is not associated
266
266
with LoggerConfig `X.Y` since tokens after periods must match exactly.
267
267
@@ -275,13 +275,13 @@ with LoggerConfig `X.Y` since tokens after periods must match exactly.
275
275
|X.Y.Z |X.Y | |ERROR
276
276
|===
277
277
278
- In example 6, LoggerConfig X.Y it has no configured level so it inherits
278
+ In example 6, LoggerConfig X.Y has no configured level so it inherits
279
279
its level from LoggerConfig X. Logger X.Y.Z uses LoggerConfig X.Y since
280
280
it doesn't have a LoggerConfig with a name that exactly matches. It too
281
281
inherits its logging level from LoggerConfig X.
282
282
283
- The table below illustrates how Level filtering works. In the table, the
284
- vertical header shows the Level of the LogEvent, while the horizontal
283
+ The table below illustrates how Level filtering works. In the table,
284
+ the vertical header shows the Level of the LogEvent, while the horizontal
285
285
header shows the Level associated with the appropriate LoggerConfig. The
286
286
intersection identifies whether the LogEvent would be allowed to pass
287
287
for further processing (Yes) or discarded (No).
@@ -348,7 +348,7 @@ be attached to a Logger.
348
348
An Appender can be added to a Logger by calling the
349
349
link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/Configuration.html#addLoggerAppender(org.apache.logging.log4j.core.Logger,%20org.apache.logging.log4j.core.Appender)[`addLoggerAppender`]
350
350
method of the current Configuration. If a LoggerConfig matching the name
351
- of the Logger does not exist, one will be created, the Appender will be
351
+ of the Logger does not exist, one will be created, and the Appender will be
352
352
attached to it and then all Loggers will be notified to update their
353
353
LoggerConfig references.
354
354
@@ -434,7 +434,7 @@ sending the formatted output to its destination. The
434
434
link:../javadoc/log4j-core/org/apache/logging/log4j/core/layout/PatternLayout.html[`PatternLayout`],
435
435
part of the standard log4j distribution, lets the user specify the
436
436
output format according to conversion patterns similar to the C language
437
- `printf` function.
437
+ `printf() ` function.
438
438
439
439
For example, the PatternLayout with the conversion pattern "%r [%t] %-5p
440
440
%c - %m%n" will output something akin to:
@@ -455,7 +455,7 @@ use cases such as JSON, XML, HTML, and Syslog (including the new RFC
455
455
specified fields instead of a particular textual layout.
456
456
457
457
Just as importantly, log4j will render the content of the log message
458
- according to user specified criteria. For example, if you frequently
458
+ according to user- specified criteria. For example, if you frequently
459
459
need to log `Oranges`, an object type used in your current project, then
460
460
you can create an OrangeMessage that accepts an Orange instance and pass
461
461
that to Log4j so that the Orange object can be formatted into an
@@ -467,16 +467,16 @@ The
467
467
link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrSubstitutor.html[`StrSubstitutor`]
468
468
class and
469
469
link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrLookup.html[`StrLookup`]
470
- interface were borrowed from
470
+ interface was borrowed from
471
471
https://commons.apache.org/proper/commons-lang/[Apache Commons Lang] and
472
472
then modified to support evaluating LogEvents. In addition the
473
473
link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/Interpolator.html[`Interpolator`]
474
474
class was borrowed from Apache Commons Configuration to allow the
475
- StrSubstitutor to evaluate variables that from multiple StrLookups. It
475
+ StrSubstitutor to evaluate variables from multiple StrLookups. It
476
476
too was modified to support evaluating LogEvents. Together these provide
477
477
a mechanism to allow the configuration to reference variables coming
478
478
from System Properties, the configuration file, the ThreadContext Map,
479
479
StructuredData in the LogEvent. The variables can either be resolved
480
- when the configuration is processed or as each event is processed, if
480
+ when the configuration is processed or as each event is processed if
481
481
the component is capable of handling it. See xref:manual/lookups.adoc[Lookups]
482
482
for more information.
0 commit comments