The logging definition file
The log4j2 file uses the XML format specified by Apache log4j-2. The entries in
log4j2.xml control what to log and to which file to write the
logging information.
This file contains a single top-level <Configuration> element with multiple subelements.
<Configuration status="...">
<Properties .../>
<Appenders .../>
<Loggers .../>
</configuration>
Often, while configuring Apache log4j-2, it is necessary to view the generated status events. Adding the status
attribute to the <Configuration> element provides a way to view status events at the specified level.
The logging elements define the following logging components:
|
A property defines a specific global value in the logging file. For example:
|
|
An appender defines a specific target location to which to write logging information. The appender definition includes such information as the log file name and the text formatting to use in the file. Examples of appenders include:
|
|
A logger defines configuration parameters associated with a specific appender. For example, this can be the logging level for a specific logging category associated with an appender. |
log4j-2 logging components, refer to the
following Apache documentation:
