Plugin reference
This page is a Javadoc-on-steroids specialized for Log4j plugins.
This reference manual is derived from the source code of all Log4j plugins and types associated with them.
You can use this reference manual to precisely customize your log4j2.xml
.
Every running Log4j system is a constellation of plugins, which is analogous to beans in Java EE and Spring. This not only allows Log4j itself to be developed in individual components, but also enables extensibility users can leverage. |
Index
Below is a list of all types reachable by plugins grouped by the Maven coordinate of the artifact bundling them.
org.apache.logging.log4j:log4j-async-logger
AsyncLogger
- Class
-
org.apache.logging.log4j.async.logger.AsyncLoggerConfig
- Provider
-
org.apache.logging.log4j:log4j-async-logger
Asynchronous Logger object that is created via configuration and can be combined with synchronous loggers.
AsyncLoggerConfig is a logger designed for high throughput and low latency logging. It does not perform any I/O in the calling (application) thread, but instead hands off the work to another thread as soon as possible. The actual logging is performed in the background thread. It uses LMAX Disruptor for inter-thread communication.
To use AsyncLoggerConfig, specify <asyncLogger>
or <asyncRoot>
in configuration.
Note that for performance reasons, this logger does not include source location by default.
You need to specify includeLocation="true"
in the configuration or any %class, %location or %line conversion patterns in your log4j.
xml configuration will produce either a "?" character or no output at all.
For best performance, use AsyncLoggerConfig with the RandomAccessFileAppender or RollingRandomAccessFileAppender, with immediateFlush=false. These appenders have built-in support for the batching mechanism used by the Disruptor library, and they will flush to disk at the end of each batch. This means that even with immediateFlush=false, there will never be any items left in the buffer; all log events will all be written to disk in a very efficient manner.
XML snippet
<AsyncLogger additivity=""
includeLocation=""
level=""
levelAndRefs=""
loggerName="">
<a-Filter-implementation/>
<AppenderRef/><!-- multiple occurrences allowed -->
<Property/><!-- multiple occurrences allowed -->
</AsyncLogger>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|||
|
|
||
|
|
AsyncRoot
- Class
-
org.apache.logging.log4j.async.logger.AsyncLoggerConfig.RootLogger
- Provider
-
org.apache.logging.log4j:log4j-async-logger
An asynchronous root Logger.
XML snippet
<AsyncRoot includeLocation=""
level=""
levelAndRefs="">
<a-Filter-implementation/>
<AppenderRef/><!-- multiple occurrences allowed -->
<Property/><!-- multiple occurrences allowed -->
</AsyncRoot>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|||
|
|
Disruptor
- Class
-
org.apache.logging.log4j.async.logger.DisruptorConfiguration
- Provider
-
org.apache.logging.log4j:log4j-async-logger
A container for:
-
A user provided wait strategy factory.
-
The common
org.apache.logging.log4j.async.logger.AsyncLoggerConfigDisruptor
instance shared by all logger configs.
TODO: the only reason the disruptor needs a holder is that org.apache.logging.log4j.async.logger.org.apache.logging.log4j.plugins.di.InstanceFactory
is currently unable to stop the services it creates.
In the future the disruptor will be in the instance factory.
org.apache.logging.log4j:log4j-conversant
com.conversantmedia.util.concurrent.SpinPolicy
- Class
-
com.conversantmedia.util.concurrent.SpinPolicy
- Provider
-
org.apache.logging.log4j:log4j-conversant
DisruptorBlockingQueue
- Class
-
org.apache.logging.log4j.conversant.DisruptorBlockingQueueFactory
- Provider
-
org.apache.logging.log4j:log4j-conversant
A BlockingQueueFactory based on Conversant Disruptor BlockingQueue.
org.apache.logging.log4j:log4j-core
org.apache.logging.log4j.Level
- Class
-
org.apache.logging.log4j.Level
- Provider
-
org.apache.logging.log4j:log4j-core
Represents a logging level. NOTE: The Log4j API supports custom levels, the following list contains only the standard ones.
org.apache.logging.log4j.core.AbstractLifeCycle
- Class
-
org.apache.logging.log4j.core.AbstractLifeCycle
- Provider
-
org.apache.logging.log4j:log4j-core
A life cycle to be extended.
Wraps a org.apache.logging.log4j.core.LifeCycle.State
.
org.apache.logging.log4j.core.Appender
- Class
-
org.apache.logging.log4j.core.Appender
- Provider
-
org.apache.logging.log4j:log4j-core
Appends org.apache.logging.log4j.core.LogEvent
s.
An Appender can contain a Layout if applicable as well as an org.apache.logging.log4j.core.ErrorHandler
. Typical Appender implementations coordinate with an implementation of org.apache.logging.log4j.core.appender.AbstractManager
to handle external resources such as streams, connections, and other shared state.
As Appenders are plugins, concrete implementations need to be annotated with org.apache.logging.log4j.core.org.apache.logging.log4j.plugins.Plugin
and need to provide a static factory method annotated with org.apache.logging.log4j.core.org.apache.logging.log4j.plugins.PluginFactory
.
Most core plugins are written using a related Manager class that handle the actual task of serializing a org.apache.logging.log4j.core.LogEvent
to some output location.
For instance, many Appenders can take advantage of the org.apache.logging.log4j.core.appender.OutputStreamManager
class.
It is recommended that Appenders don’t do any heavy lifting since there can be many instances of the class being used at any given time.
When resources require locking (e.g., through org.apache.logging.log4j.core.java.nio.channels.FileLock
), it is important to isolate synchronized code to prevent concurrency issues.
org.apache.logging.log4j.core.Filter
- Class
-
org.apache.logging.log4j.core.Filter
- Provider
-
org.apache.logging.log4j:log4j-core
Interface that must be implemented to allow custom event filtering.
It is highly recommended that applications make use of the Filters provided with this implementation before creating their own.
This interface supports "global" filters (i.e. - all events must pass through them first), attached to specific loggers and associated with Appenders. It is recommended that, where possible, Filter implementations create a generic filtering method that can be called from any of the filter methods.
org.apache.logging.log4j.core.Filter.Result
- Class
-
org.apache.logging.log4j.core.Filter.Result
- Provider
-
org.apache.logging.log4j:log4j-core
The result that can returned from a filter method call.
org.apache.logging.log4j.core.Layout
- Class
-
org.apache.logging.log4j.core.Layout
- Provider
-
org.apache.logging.log4j:log4j-core
Converts org.apache.logging.log4j.core.LogEvent
instances into different layouts of data.
A layout typically encodes into either a java.lang.String
or byte[]
. Since version 2.6, layouts implement Encoder to support direct encoding of a log event into a org.apache.logging.log4j.core.layout.ByteBufferDestination
without creating temporary intermediary objects.
Since version 3.0.0, layouts no longer reference the legacy Java serialization API and are limited to strings or bytes.
org.apache.logging.log4j.core.LifeCycle
- Class
-
org.apache.logging.log4j.core.LifeCycle
- Provider
-
org.apache.logging.log4j:log4j-core
All proper Java frameworks implement some sort of object life cycle.
In Log4j, the main interface for handling the life cycle context of an object is this one.
An object first starts in the org.apache.logging.log4j.core.State#INITIALIZED
state by default to indicate the class has been loaded.
From here, calling the LifeCycle method will change this state to org.apache.logging.log4j.core.State#STARTING
. After successfully being started, this state is changed to org.apache.logging.log4j.core.State#STARTED
. When the LifeCycle is called, this goes into the org.apache.logging.log4j.core.State#STOPPING
state.
After successfully being stopped, this goes into the org.apache.logging.log4j.core.State#STOPPED
state.
In most circumstances, implementation classes should store their org.apache.logging.log4j.core.State
in a volatile
field or inside an org.apache.logging.log4j.core.java.util.concurrent.atomic.AtomicReference
dependent on synchronization and concurrency requirements.
org.apache.logging.log4j.core.StringLayout
- Class
-
org.apache.logging.log4j.core.StringLayout
- Provider
-
org.apache.logging.log4j:log4j-core
Legacy interface from when layouts used to support more than strings or bytes.
org.apache.logging.log4j.core.appender.AbstractAppender
- Class
-
org.apache.logging.log4j.core.appender.AbstractAppender
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract base class for Appenders.
Although Appenders do not have to extend this class, doing so will simplify their implementation.
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
- Class
-
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
- Provider
-
org.apache.logging.log4j:log4j-core
Appends log events as bytes to a byte output stream.
The stream encoding is defined in the layout.
AppenderSet
- Class
-
org.apache.logging.log4j.core.appender.AppenderSet
- Provider
-
org.apache.logging.log4j:log4j-core
A deferred plugin for appenders.
Async
- Class
-
org.apache.logging.log4j.core.appender.AsyncAppender
- Provider
-
org.apache.logging.log4j:log4j-core
Appends to one or more Appenders asynchronously.
You can configure an AsyncAppender with one or more Appenders and an Appender to append to if the queue is full. The AsyncAppender does not allow a filter to be specified on the Appender references.
XML snippet
<Async blocking=""
bufferSize=""
errorRef=""
ignoreExceptions=""
includeLocation=""
name=""
shutdownTimeout="">
<a-Filter-implementation/>
<a-BlockingQueueFactory-implementation/>
<AppenderRef/><!-- multiple occurrences allowed -->
<Property/><!-- multiple occurrences allowed -->
</Async>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Name of the appender to use in references |
|
|
|
Console
- Class
-
org.apache.logging.log4j.core.appender.ConsoleAppender
- Provider
-
org.apache.logging.log4j:log4j-core
Appends log events to System. out
or System. err
using a layout specified by the user.
The default target is System. out
.
TODO Accessing System. out
or System. err
as a byte stream instead of a writer bypasses the JVM’s knowledge of the proper encoding.
(RG) Encoding is handled within the Layout.
Typically, a Layout will generate a String and then call getBytes which may use a configured encoding or the system default.
OTOH, a Writer cannot print byte streams.
XML snippet
<Console bufferedIo=""
bufferSize=""
direct=""
follow=""
ignoreExceptions=""
immediateFlush=""
name=""
target="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
</Console>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
Name of the appender to use in references |
|
|
org.apache.logging.log4j.core.appender.ConsoleAppender.Target
- Class
-
org.apache.logging.log4j.core.appender.ConsoleAppender.Target
- Provider
-
org.apache.logging.log4j:log4j-core
Enumeration of console destinations.
CountingNoOp
- Class
-
org.apache.logging.log4j.core.appender.CountingNoOpAppender
- Provider
-
org.apache.logging.log4j:log4j-core
No-Operation Appender that counts events.
Failover
- Class
-
org.apache.logging.log4j.core.appender.FailoverAppender
- Provider
-
org.apache.logging.log4j:log4j-core
The FailoverAppender will capture exceptions in an Appender and then route the event to a different appender.
Hopefully it is obvious that the Appenders must be configured to not suppress exceptions for the FailoverAppender to work.
XML snippet
<Failover ignoreExceptions=""
name=""
primary=""
retryIntervalSeconds="">
<a-String-implementation/><!-- multiple occurrences allowed -->
<a-Filter-implementation/>
</Failover>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
The name of the Appender (required). |
|
|
|
The name of the primary Appender (required). |
|
|
|
The retry interval in seconds. |
Failovers
- Class
-
org.apache.logging.log4j.core.appender.FailoversPlugin
- Provider
-
org.apache.logging.log4j:log4j-core
The array of failover Appenders.
File
- Class
-
org.apache.logging.log4j.core.appender.FileAppender
- Provider
-
org.apache.logging.log4j:log4j-core
File Appender.
XML snippet
<File advertise=""
advertiseUri=""
append=""
bufferedIo=""
bufferSize=""
createOnDemand=""
fileGroup=""
fileName=""
fileOwner=""
filePermissions=""
ignoreExceptions=""
immediateFlush=""
locking=""
name="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
</File>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
||
|
|
Name of the appender to use in references |
Http
- Class
-
org.apache.logging.log4j.core.appender.HttpAppender
- Provider
-
org.apache.logging.log4j:log4j-core
Sends log events over HTTP.
XML snippet
<Http connectTimeoutMillis=""
ignoreExceptions=""
method=""
name=""
readTimeoutMillis=""
url=""
verifyHostname="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
<Ssl/>
</Http>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
||
|
|
Name of the appender to use in references |
|
|
|
||
|
|
||
|
|
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
A generic list of key/value properties The meaning of these properties depends on the component. |
|
If not |
||
Formats the log events |
||
|
MemoryMappedFile
- Class
-
org.apache.logging.log4j.core.appender.MemoryMappedFileAppender
- Provider
-
org.apache.logging.log4j:log4j-core
Memory Mapped File Appender.
XML snippet
<MemoryMappedFile advertise=""
advertiseURI=""
append=""
bufferedIo=""
bufferSize=""
fileName=""
ignoreExceptions=""
immediateFlush=""
name=""
regionLength="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
</MemoryMappedFile>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
Name of the appender to use in references |
|
|
|
Null
- Class
-
org.apache.logging.log4j.core.appender.NullAppender
- Provider
-
org.apache.logging.log4j:log4j-core
An Appender that ignores log events.
Use for compatibility with version 1.2 and handy for composing a ScriptAppenderSelector
.
RandomAccessFile
- Class
-
org.apache.logging.log4j.core.appender.RandomAccessFileAppender
- Provider
-
org.apache.logging.log4j:log4j-core
File Appender.
XML snippet
<RandomAccessFile advertise=""
advertiseURI=""
append=""
bufferedIo=""
bufferSize=""
fileName=""
ignoreExceptions=""
immediateFlush=""
name="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
</RandomAccessFile>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
Name of the appender to use in references |
RollingFile
- Class
-
org.apache.logging.log4j.core.appender.RollingFileAppender
- Provider
-
org.apache.logging.log4j:log4j-core
An appender that writes to files and can roll over at intervals.
XML snippet
<RollingFile advertise=""
advertiseUri=""
append=""
bufferedIo=""
bufferSize=""
createOnDemand=""
fileGroup=""
fileName=""
fileOwner=""
filePattern=""
filePermissions=""
ignoreExceptions=""
immediateFlush=""
locking=""
name="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<a-RolloverStrategy-implementation/>
<a-TriggeringPolicy-implementation/>
<Property/><!-- multiple occurrences allowed -->
</RollingFile>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
||
|
|
Name of the appender to use in references |
RollingRandomAccessFile
- Class
-
org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender
- Provider
-
org.apache.logging.log4j:log4j-core
An appender that writes to random access files and can roll over at intervals.
XML snippet
<RollingRandomAccessFile advertise=""
advertiseURI=""
append=""
bufferedIo=""
bufferSize=""
fileGroup=""
fileName=""
fileOwner=""
filePattern=""
filePermissions=""
ignoreExceptions=""
immediateFlush=""
name="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<a-RolloverStrategy-implementation/>
<a-TriggeringPolicy-implementation/>
<Property/><!-- multiple occurrences allowed -->
</RollingRandomAccessFile>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
Name of the appender to use in references |
Socket
- Class
-
org.apache.logging.log4j.core.appender.SocketAppender
- Provider
-
org.apache.logging.log4j:log4j-core
An Appender that delivers events over socket connections.
Supports both TCP and UDP.
XML snippet
<Socket advertise=""
bufferedIo=""
bufferSize=""
connectTimeoutMillis=""
host=""
ignoreExceptions=""
immediateFail=""
immediateFlush=""
name=""
port=""
protocol=""
reconnectDelayMillis="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
<SocketOptions/>
<Ssl/>
</Socket>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
||
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
Name of the appender to use in references |
|
|
|
||
|
|||
|
|
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
A generic list of key/value properties The meaning of these properties depends on the component. |
|
If not |
||
Formats the log events |
||
|
||
|
Syslog
- Class
-
org.apache.logging.log4j.core.appender.SyslogAppender
- Provider
-
org.apache.logging.log4j:log4j-core
The Syslog Appender.
XML snippet
<Syslog advertise=""
appName=""
bufferedIo=""
bufferSize=""
charset=""
connectTimeoutMillis=""
enterpriseNumber=""
eventPrefix=""
exceptionPattern=""
facility=""
format=""
host=""
id=""
ignoreExceptions=""
immediateFail=""
immediateFlush=""
includeMdc=""
mdcExcludes=""
mdcId=""
mdcIncludes=""
mdcPrefix=""
mdcRequired=""
messageId=""
name=""
newLine=""
newLineEscape=""
port=""
protocol=""
reconnectDelayMillis="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<Property/><!-- multiple occurrences allowed -->
<LoggerFields/><!-- multiple occurrences allowed -->
<SocketOptions/>
<Ssl/>
</Syslog>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
Determines whether to use a buffered If set to |
|
|
|
Size of the buffer in bytes |
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
||
|
|
Flushes the underlying The effects of this setting depend on the output stream implementation (see Setting this to |
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
Name of the appender to use in references |
|
|
|
||
|
|
||
|
|
||
|
|||
|
|
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
A generic list of key/value properties The meaning of these properties depends on the component. |
|
If not |
||
Formats the log events |
||
|
||
|
||
|
org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender
- Class
-
org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender
- Provider
-
org.apache.logging.log4j:log4j-core
An abstract Appender for writing events to a database of some type, be it relational or NoSQL.
All database appenders should inherit from this base appender.
ColumnMapping
- Class
-
org.apache.logging.log4j.core.appender.db.ColumnMapping
- Provider
-
org.apache.logging.log4j:log4j-core
A configuration element for specifying a database column name mapping.
XML snippet
<ColumnMapping literal=""
name=""
parameter=""
pattern=""
source=""
type="">
<a-StringLayout-implementation/>
</ColumnMapping>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Literal value to use for populating a column. This is generally useful for functions, stored procedures, etc. No escaping will be done on this value. |
|
|
|
Column name. |
|
|
|
Parameter value to use for populating a column, MUST contain a single parameter marker '?'. This is generally useful for functions, stored procedures, etc. No escaping will be done on this value. |
|
|
|
Pattern to use as a PatternLayout. Convenient shorthand for ColumnMapping with a PatternLayout. |
|
|
|
Source name. Useful when combined with a |
|
|
|
Class to convert value to before storing in database. If the type is compatible with |
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
Layout of value to write to database (before type conversion). Not applicable if ColumnMapping is a |
NoSql
- Class
-
org.apache.logging.log4j.core.appender.nosql.NoSqlAppender
- Provider
-
org.apache.logging.log4j:log4j-core
This Appender writes logging events to a NoSQL database using a configured NoSQL provider.
It requires implementations of org.apache.logging.log4j.core.appender.nosql.NoSqlObject
, org.apache.logging.log4j.core.appender.nosql.NoSqlConnection
, and NoSqlProvider to "know" how to write events to the chosen NoSQL database.
For examples on how to write your own NoSQL provider, see the simple source code for the MongoDB providers.
XML snippet
<NoSql bufferSize=""
ignoreExceptions=""
name="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<a-NoSqlProvider-implementation/>
<Property/><!-- multiple occurrences allowed -->
<KeyValuePair/><!-- multiple occurrences allowed -->
</NoSql>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Sets the buffer size. |
|
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Name of the appender to use in references |
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
Sets the provider. |
||
|
A generic list of key/value properties The meaning of these properties depends on the component. |
|
If not |
||
Formats the log events |
||
|
LoggerNameLevelRewritePolicy
- Class
-
org.apache.logging.log4j.core.appender.rewrite.LoggerNameLevelRewritePolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Rewrites log event levels for a given logger name.
XML snippet
<LoggerNameLevelRewritePolicy logger="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</LoggerNameLevelRewritePolicy>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The logger name prefix for events to rewrite; all event logger names that start with this string will be rewritten. |
MapRewritePolicy
- Class
-
org.apache.logging.log4j.core.appender.rewrite.MapRewritePolicy
- Provider
-
org.apache.logging.log4j:log4j-core
This policy modifies events by replacing or possibly adding keys and values to the MapMessage.
XML snippet
<MapRewritePolicy mode="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</MapRewritePolicy>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The string representation of the Mode. |
PropertiesRewritePolicy
- Class
-
org.apache.logging.log4j.core.appender.rewrite.PropertiesRewritePolicy
- Provider
-
org.apache.logging.log4j:log4j-core
This policy modifies events by replacing or possibly adding keys and values to the MapMessage.
Rewrite
- Class
-
org.apache.logging.log4j.core.appender.rewrite.RewriteAppender
- Provider
-
org.apache.logging.log4j:log4j-core
This Appender allows the logging event to be manipulated before it is processed by other Appenders.
XML snippet
<Rewrite ignoreExceptions=""
name="">
<a-Filter-implementation/>
<a-RewritePolicy-implementation/>
<AppenderRef/><!-- multiple occurrences allowed -->
</Rewrite>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
If |
|
|
|
The name of the Appender. |
org.apache.logging.log4j.core.appender.rewrite.RewritePolicy
- Class
-
org.apache.logging.log4j.core.appender.rewrite.RewritePolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Interface to be implemented by components that support modifications to the LogEvent.
org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy
- Class
-
org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy
- Provider
-
org.apache.logging.log4j:log4j-core
org.apache.logging.log4j.core.appender.rolling.AbstractTriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.AbstractTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract convenience class for triggering policies that extend AbstractLifeCycle and implement TriggeringPolicy.
Policies
- Class
-
org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Triggering policy that wraps other triggering policies.
CronTriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.CronTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Rolls a file over based on a cron schedule.
DefaultRolloverStrategy
- Class
-
org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy
- Provider
-
org.apache.logging.log4j:log4j-core
When rolling over, DefaultRolloverStrategy
renames files according to an algorithm as described below.
The DefaultRolloverStrategy is a combination of a time-based policy and a fixed-window policy. When the file name pattern contains a date format then the rollover time interval will be used to calculate the time to use in the file pattern. When the file pattern contains an integer replacement token one of the counting techniques will be used.
When the ascending attribute is set to true (the default) then the counter will be incremented and the current log file will be renamed to include the counter value. If the counter hits the maximum value then the oldest file, which will have the smallest counter, will be deleted, all other files will be renamed to have their counter decremented and then the current file will be renamed to have the maximum counter value. Note that with this counting strategy specifying a large maximum value may entirely avoid renaming files.
When the ascending attribute is false, then the "normal" fixed-window strategy will be used.
Let max and min represent the values of respectively the MaxIndex and MinIndex options.
Let "foo.
log" be the value of the ActiveFile option and "foo.
%i.log" the value of FileNamePattern. Then, when rolling over, the file foo. max.log
will be deleted, the file foo. max-1.log
will be renamed as foo. max.log
, the file foo. max-2.log
renamed as foo. max-1.log
, and so on, the file foo. min+1.log
renamed as foo. min+2.log
. Lastly, the active file foo. log
will be renamed as foo. min.log
and a new active file name foo. log
will be created.
Given that this rollover algorithm requires as many file renaming operations as the window size, large window sizes are discouraged.
XML snippet
<DefaultRolloverStrategy fileIndex=""
max=""
min=""
stopCustomActionsOnError=""
tempCompressedFilePattern="">
<a-Action-implementation/><!-- multiple occurrences allowed -->
</DefaultRolloverStrategy>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Defines the file index for rolling strategy. |
|
|
|
Defines the maximum number of files to keep. |
|
|
|
Defines the minimum number of files to keep. |
|
|
|
Defines whether to stop executing asynchronous actions if an error occurs. |
|
|
|
Defines temporary compression file pattern. |
org.apache.logging.log4j.core.appender.rolling.DirectFileRolloverStrategy
- Class
-
org.apache.logging.log4j.core.appender.rolling.DirectFileRolloverStrategy
- Provider
-
org.apache.logging.log4j:log4j-core
Created by rgoers on 1/12/17.
DirectWriteRolloverStrategy
- Class
-
org.apache.logging.log4j.core.appender.rolling.DirectWriteRolloverStrategy
- Provider
-
org.apache.logging.log4j:log4j-core
When rolling over, DirectWriteRolloverStrategy
writes directly to the file as resolved by the file pattern.
Files will be renamed files according to an algorithm as described below.
The DirectWriteRolloverStrategy uses similar logic as DefaultRolloverStrategy to determine the file name based on the file pattern, however the DirectWriteRolloverStrategy writes directly to a file and does not rename it during rollover, except if it is compressed, in which case it will add the appropriate file extension.
XML snippet
<DirectWriteRolloverStrategy maxFiles=""
stopCustomActionsOnError=""
tempCompressedFilePattern="">
<a-Action-implementation/><!-- multiple occurrences allowed -->
</DirectWriteRolloverStrategy>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Defines the maximum number of files to keep. |
|
|
|
Defines whether to stop executing asynchronous actions if an error occurs. |
|
|
|
Defines temporary compression file pattern. |
NoOpTriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.NoOpTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
OnStartupTriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.OnStartupTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Triggers a rollover on every restart, but only if the file size is greater than zero.
org.apache.logging.log4j.core.appender.rolling.RolloverStrategy
- Class
-
org.apache.logging.log4j.core.appender.rolling.RolloverStrategy
- Provider
-
org.apache.logging.log4j:log4j-core
A RollingPolicy
specifies the actions taken on a logging file rollover.
SizeBasedTriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
TimeBasedTriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.TimeBasedTriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Rolls a file over based on time.
org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy
- Class
-
org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy
- Provider
-
org.apache.logging.log4j:log4j-core
A TriggeringPolicy
controls the conditions under which rollover occurs.
Such conditions include time of day, file size, an external event, the log request or a combination thereof.
org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract base class for implementations of Action.
org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract action for processing files that are accepted by the specified PathFilters.
org.apache.logging.log4j.core.appender.rolling.action.Action
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.Action
- Provider
-
org.apache.logging.log4j:log4j-core
The Action interface should be implemented by any class that performs file system actions for RollingFileAppenders after the close of the active log file.
org.apache.logging.log4j.core.appender.rolling.action.CompressActionFactoryProvider
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.CompressActionFactoryProvider
- Provider
-
org.apache.logging.log4j:log4j-core
Interface for plugins that provide additional compression algorithms.
Delete
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.DeleteAction
- Provider
-
org.apache.logging.log4j:log4j-core
Rollover or scheduled action for deleting old log files that are accepted by the specified PathFilters.
XML snippet
<Delete basePath=""
followLinks=""
maxDepth=""
testMode="">
<a-PathCondition-implementation/><!-- multiple occurrences allowed -->
<a-PathSorter-implementation/>
<a-ScriptConditional-implementation/>
</Delete>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
base path from where to start scanning for files to delete. |
|
|
|
whether to follow symbolic links. Default is false. |
|
|
|
The maxDepth parameter is the maximum number of levels of directories to visit. A value of 0 means that only the starting file is visited, unless denied by the security manager. A value of MAX_VALUE may be used to indicate that all levels should be visited. |
|
|
|
if true, files are not deleted but instead a message is printed to the status logger at INFO level. Users can use this to do a dry run to test if their configuration works as expected. Default is false. |
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
an array of path conditions (if more than one, they all need to accept a path before it is deleted). |
||
a plugin implementing the PathSorter interface |
||
IfAccumulatedFileCount
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfAccumulatedFileCount
- Provider
-
org.apache.logging.log4j:log4j-core
PathCondition that accepts paths after some count threshold is exceeded during the file tree walk.
XML snippet
<IfAccumulatedFileCount exceeds="">
<a-PathCondition-implementation/><!-- multiple occurrences allowed -->
</IfAccumulatedFileCount>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The threshold count from which files will be deleted. |
IfAccumulatedFileSize
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfAccumulatedFileSize
- Provider
-
org.apache.logging.log4j:log4j-core
PathCondition that accepts paths after the accumulated file size threshold is exceeded during the file tree walk.
XML snippet
<IfAccumulatedFileSize exceeds="">
<a-PathCondition-implementation/><!-- multiple occurrences allowed -->
</IfAccumulatedFileSize>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The threshold accumulated file size from which files will be deleted. |
IfAll
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfAll
- Provider
-
org.apache.logging.log4j:log4j-core
Composite PathCondition
that only accepts objects that are accepted by all component conditions.
Corresponds to logical "AND".
IfAny
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfAny
- Provider
-
org.apache.logging.log4j:log4j-core
Composite PathCondition
that accepts objects that are accepted by any component conditions.
Corresponds to logical "OR".
IfFileName
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfFileName
- Provider
-
org.apache.logging.log4j:log4j-core
PathCondition that accepts files for deletion if their relative path matches either a glob pattern or a regular expression.
If both a regular expression and a glob pattern are specified the glob pattern is used and the regular expression is ignored.
The regular expression is a pattern as defined by the java.util.regex.Pattern
class.
A glob is a simplified pattern expression described in java.nio.file.FileSystem#getPathMatcher(String)
.
XML snippet
<IfFileName glob=""
regex="">
<a-PathCondition-implementation/><!-- multiple occurrences allowed -->
</IfFileName>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
the baseDir-relative path pattern of the files to delete (may contain '*' and '?' wildcarts) |
|
|
|
the regular expression that matches the baseDir-relative path of the file(s) to delete |
IfLastModified
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfLastModified
- Provider
-
org.apache.logging.log4j:log4j-core
PathCondition that accepts paths that are older than the specified duration.
XML snippet
<IfLastModified age="">
<a-PathCondition-implementation/><!-- multiple occurrences allowed -->
</IfLastModified>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
IfNot
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.IfNot
- Provider
-
org.apache.logging.log4j:log4j-core
Wrapper PathCondition
that accepts objects that are rejected by the wrapped component filter.
org.apache.logging.log4j.core.appender.rolling.action.PathCondition
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.PathCondition
- Provider
-
org.apache.logging.log4j:log4j-core
Filter that accepts or rejects a candidate Path
for deletion.
SortByModificationTime
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.PathSortByModificationTime
- Provider
-
org.apache.logging.log4j:log4j-core
PathSorter that sorts path by their LastModified attribute.
org.apache.logging.log4j.core.appender.rolling.action.PathSorter
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.PathSorter
- Provider
-
org.apache.logging.log4j:log4j-core
Defines the interface of classes that can sort Paths.
PosixViewAttribute
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.PosixViewAttributeAction
- Provider
-
org.apache.logging.log4j:log4j-core
File POSIX attribute view action.
Allow to define file permissions, user and group for log files on POSIX supported OS.
XML snippet
<PosixViewAttribute basePath=""
fileGroup=""
fileOwner=""
filePermissions=""
followLinks=""
maxDepth="">
<a-PathCondition-implementation/><!-- multiple occurrences allowed -->
</PosixViewAttribute>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Define base path to apply condition before execute POSIX file attribute action. |
|
|
|
Define file group to apply during action execution eligible files. |
|
|
|
Define file owner to apply during action execution eligible files. |
|
|
|
Define file permissions in POSIX format to apply during action execution eligible files. Example: rw-rw-rw r—r—r-- |
|
|
|
True to allow synonyms links during search of eligible files. |
|
|
|
Define max folder depth to search for eligible files to apply POSIX attribute view. |
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
Define path conditions to filter files in PosixViewAttributeAction. |
JreCompressActionFactoryProvider
- Class
-
org.apache.logging.log4j.core.appender.rolling.action.internal.JreCompressActionFactoryProvider
- Provider
-
org.apache.logging.log4j:log4j-core
IdlePurgePolicy
- Class
-
org.apache.logging.log4j.core.appender.routing.IdlePurgePolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Policy is purging appenders that were not in use specified time in minutes
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
when all appenders purged, the number of increments of timeUnit to check if any appenders appeared |
|
|
|
the number of increments of timeUnit before the Appender should be purged. |
|
|
|
the unit of time the timeToLive and the checkInterval is expressed in. |
org.apache.logging.log4j.core.appender.routing.PurgePolicy
- Class
-
org.apache.logging.log4j.core.appender.routing.PurgePolicy
- Provider
-
org.apache.logging.log4j:log4j-core
Policy for purging routed appenders
Route
- Class
-
org.apache.logging.log4j.core.appender.routing.Route
- Provider
-
org.apache.logging.log4j:log4j-core
A Route to an appender.
Routes
- Class
-
org.apache.logging.log4j.core.appender.routing.Routes
- Provider
-
org.apache.logging.log4j:log4j-core
Contains the individual Route elements.
XML snippet
<Routes pattern="">
<Route/><!-- multiple occurrences allowed -->
<a-Script-implementation/>
</Routes>
Routing
- Class
-
org.apache.logging.log4j.core.appender.routing.RoutingAppender
- Provider
-
org.apache.logging.log4j:log4j-core
This Appender "routes" between various Appenders, some of which can be references to Appenders defined earlier in the configuration while others can be dynamically created within this Appender as required.
Routing is achieved by specifying a pattern on the Routing appender declaration. The pattern should contain one or more substitution patterns of the form "$${[key:]token}". The pattern will be resolved each time the Appender is called using the built in StrSubstitutor and the StrLookup plugin that matches the specified key.
XML snippet
<Routing ignoreExceptions=""
name="">
<a-Boolean-implementation/>
<a-Filter-implementation/>
<a-Layout-implementation/>
<a-RewritePolicy-implementation/>
<a-PurgePolicy-implementation/>
<Routes/>
<Property/><!-- multiple occurrences allowed -->
<a-Script-implementation/>
</Routing>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Determines whether to propagate logging exceptions If set to If set to |
|
|
|
Name of the appender to use in references |
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
||
|
||
|
A generic list of key/value properties The meaning of these properties depends on the component. |
|
If not |
||
Formats the log events |
||
ArrayBlockingQueue
- Class
-
org.apache.logging.log4j.core.async.ArrayBlockingQueueFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Factory for creating instances of java.util.concurrent.ArrayBlockingQueue
.
org.apache.logging.log4j.core.async.BlockingQueueFactory
- Class
-
org.apache.logging.log4j.core.async.BlockingQueueFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Factory for creating instances of java.util.concurrent.BlockingQueue
.
LinkedTransferQueue
- Class
-
org.apache.logging.log4j.core.async.LinkedTransferQueueFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Factory for creating instances of java.util.concurrent.LinkedTransferQueue
.
AppenderRef
- Class
-
org.apache.logging.log4j.core.config.AppenderRef
- Provider
-
org.apache.logging.log4j:log4j-core
An Appender reference.
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
The Level to filter against. |
||
|
|
The name of the Appender. |
Appenders
- Class
-
org.apache.logging.log4j.core.config.AppendersPlugin
- Provider
-
org.apache.logging.log4j:log4j-core
An Appender container.
Configuration
- Class
-
org.apache.logging.log4j.core.config.Configuration
- Provider
-
org.apache.logging.log4j:log4j-core
A Log4j configuration contains many components of which two are required: Appenders
and Loggers
.
XML snippet
<Configuration dest="err"
monitorInterval="0"
name=""
schema=""
shutdownHook=""
shutdownTimeout=""
status="ERROR"
strict="false">
<Properties/>
<Appenders/>
<CustomLevels/>
<Loggers/>
</Configuration>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
|
Specifies the destination for status logger events. The possible values are:
If the provided value is invalid, then the default destination of standard out will be used. |
|
|
|
Number of seconds between polls for configuration changes |
|
|
Name of the configuration |
|
|
|
The name of a classpath resource to use to validate the configuration |
|
|
|
Indicates if Log4j should automatically shut down when the JVM shuts down.
Possible values are |
|
|
|
Timeout in milliseconds of the logger context shut down |
|
|
|
Sets the level of the status logger |
|
|
|
|
If set to |
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
Wrapper element for a list of appenders |
|
|
Wrapper element for a list of custom levels |
|
|
Wrapper element for a list of logger configurations |
|
|
Wrapper element for a list of properties |
org.apache.logging.log4j.core.config.ConfigurationAware
- Class
-
org.apache.logging.log4j.core.config.ConfigurationAware
- Provider
-
org.apache.logging.log4j:log4j-core
Indicates that a class requests the current Configuration to be injected.
org.apache.logging.log4j.core.config.ConfigurationFactory
- Class
-
org.apache.logging.log4j.core.config.ConfigurationFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Factory class for parsed org.apache.logging.log4j.core.config.Configuration
objects from a configuration file.
ConfigurationFactory allows the configuration implementation to be dynamically chosen in 1 of 3 ways:
-
A system property named "log4j. configuration. factory" can be set with the name of the ConfigurationFactory to be used.
-
A
org.apache.logging.log4j.plugins.di.ConfigurableInstanceFactory
binding for ConfigurationFactory may be registered. -
A ConfigurationFactory implementation can be added to the classpath and configured as a plugin in the ConfigurationFactory category. The
org.apache.logging.log4j.core.config.Order
annotation should be used to configure the factory to be the first one inspected. See XmlConfigurationFactory for an example.
If the ConfigurationFactory that was added returns null on a call to getConfiguration then any other ConfigurationFactories found as plugins will be called in their respective order. DefaultConfiguration is always called last if no configuration has been returned.
CustomLevel
- Class
-
org.apache.logging.log4j.core.config.CustomLevelConfig
- Provider
-
org.apache.logging.log4j:log4j-core
Descriptor of a custom Level object that is created via configuration.
CustomLevels
- Class
-
org.apache.logging.log4j.core.config.CustomLevels
- Provider
-
org.apache.logging.log4j:log4j-core
Container for CustomLevelConfig objects.
Default
- Class
-
org.apache.logging.log4j.core.config.DefaultAdvertiser
- Provider
-
org.apache.logging.log4j:log4j-core
The default advertiser does not do anything.
http
- Class
-
org.apache.logging.log4j.core.config.HttpWatcher
- Provider
-
org.apache.logging.log4j:log4j-core
Logger
- Class
-
org.apache.logging.log4j.core.config.LoggerConfig
- Provider
-
org.apache.logging.log4j:log4j-core
Logger object that is created via configuration.
XML snippet
<Logger additivity=""
includeLocation=""
level=""
levelAndRefs=""
loggerName="">
<a-Filter-implementation/>
<AppenderRef/><!-- multiple occurrences allowed -->
<Property/><!-- multiple occurrences allowed -->
</Logger>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|||
|
|
||
|
|
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
||
|
||
Root
- Class
-
org.apache.logging.log4j.core.config.LoggerConfig.RootLogger
- Provider
-
org.apache.logging.log4j:log4j-core
The root Logger.
XML snippet
<Root includeLocation=""
level=""
levelAndRefs="">
<a-Filter-implementation/>
<AppenderRef/><!-- multiple occurrences allowed -->
<Property/><!-- multiple occurrences allowed -->
</Root>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|||
|
|
Loggers
- Class
-
org.apache.logging.log4j.core.config.LoggersPlugin
- Provider
-
org.apache.logging.log4j:log4j-core
Container of Logger objects.
Properties
- Class
-
org.apache.logging.log4j.core.config.PropertiesPlugin
- Provider
-
org.apache.logging.log4j:log4j-core
Handles properties defined in the configuration.
Property
- Class
-
org.apache.logging.log4j.core.config.Property
- Provider
-
org.apache.logging.log4j:log4j-core
Represents a key/value pair in the configuration.
org.apache.logging.log4j.core.config.URIConfigurationFactory
- Class
-
org.apache.logging.log4j.core.config.URIConfigurationFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Creates configuration from an java.net.URI
.
org.apache.logging.log4j.core.config.arbiters.Arbiter
- Class
-
org.apache.logging.log4j.core.config.arbiters.Arbiter
- Provider
-
org.apache.logging.log4j:log4j-core
Interface used to check for portions of the configuration that may be optionally included.
ClassArbiter
- Class
-
org.apache.logging.log4j.core.config.arbiters.ClassArbiter
- Provider
-
org.apache.logging.log4j:log4j-core
Conditional that determines if the specified class is present.
DefaultArbiter
- Class
-
org.apache.logging.log4j.core.config.arbiters.DefaultArbiter
- Provider
-
org.apache.logging.log4j:log4j-core
Default Condition for a Select Condition.
EnvironmentArbiter
- Class
-
org.apache.logging.log4j.core.config.arbiters.EnvironmentArbiter
- Provider
-
org.apache.logging.log4j:log4j-core
Condition that determines if the specified environment variable is set.
Select
- Class
-
org.apache.logging.log4j.core.config.arbiters.SelectArbiter
- Provider
-
org.apache.logging.log4j:log4j-core
Class Description goes here.
SystemPropertyArbiter
- Class
-
org.apache.logging.log4j.core.config.arbiters.SystemPropertyArbiter
- Provider
-
org.apache.logging.log4j:log4j-core
Condition that determines if the specified property is set.
org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory
- Class
-
org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Provides methods to create ConfigurationBuilders.
JsonConfigurationFactory
- Class
-
org.apache.logging.log4j.core.config.json.JsonConfigurationFactory
- Provider
-
org.apache.logging.log4j:log4j-core
BigDecimalConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.BigDecimalConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Parses a java.lang.String
into a java.math.BigDecimal
.
BigIntegerConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.BigIntegerConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Parses a java.lang.String
into a java.math.BigInteger
.
ByteArrayConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.ByteArrayConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a byte[]
.
The supported formats are:
-
0x0123456789ABCDEF
-
Base64:ABase64String
-
String using
java.nio.charset.Charset#defaultCharset()
[TODO Should this be UTF-8 instead? ]
CharArrayConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.CharArrayConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a char[]
.
CharsetConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.CharsetConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.nio.charset.Charset
.
ClassConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.ClassConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.lang.Class
.
CronExpressionConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.CronExpressionConverter
- Provider
-
org.apache.logging.log4j:log4j-core
DurationConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.DurationConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.time.Duration
.
FileConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.FileConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.io.File
.
InetAddressConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.InetAddressConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into an java.net.InetAddress
.
LevelConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.LevelConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a Log4j Level.
Returns null
for invalid level names.
PathConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.PathConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.nio.file.Path
.
PatternConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.PatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.util.regex.Pattern
.
SecurityProviderConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.SecurityProviderConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.security.Provider
.
UriConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.UriConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.net.URI
.
UrlConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.UrlConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.net.URL
.
UuidConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.UuidConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts a java.lang.String
into a java.util.UUID
.
ZoneIdConverter
- Class
-
org.apache.logging.log4j.core.config.plugins.convert.CoreTypeConverters.ZoneIdConverter
- Provider
-
org.apache.logging.log4j:log4j-core
XmlConfigurationFactory
- Class
-
org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory
- Provider
-
org.apache.logging.log4j:log4j-core
Factory to construct an XmlConfiguration.
org.apache.logging.log4j.core.filter.AbstractFilter
- Class
-
org.apache.logging.log4j.core.filter.AbstractFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Users should extend this class to implement filters.
Filters can be either context wide or attached to an appender.
A filter may choose to support being called only from the context or only from an appender in which case it will only implement the required method(s). The rest will default to return org.apache.logging.log4j.core.filter.org.apache.logging.log4j.core.Filter.Result#NEUTRAL
.
Garbage-free note: the methods with unrolled varargs by default delegate to the apiref:org.apache.logging.log4j.core.filter.AbstractFilter#filter(Logger, Level, Marker, String, Object…)[filter method with vararg parameters]. Subclasses that want to be garbage-free should override these methods to implement the appropriate filtering without creating a vararg array.
org.apache.logging.log4j.core.filter.AbstractFilterable
- Class
-
org.apache.logging.log4j.core.filter.AbstractFilterable
- Provider
-
org.apache.logging.log4j:log4j-core
Enhances a Class by allowing it to contain Filters.
BurstFilter
- Class
-
org.apache.logging.log4j.core.filter.BurstFilter
- Provider
-
org.apache.logging.log4j:log4j-core
The BurstFilter
is a logging filter that regulates logging traffic.
Use this filter when you want to control the maximum burst of log statements that can be sent to an appender.
The filter is configured in the log4j configuration file.
For example, the following configuration limits the number of INFO level (as well as DEBUG and TRACE) log statements that can be sent to the console to a burst of 100 with an average rate of 16 per second.
WARN, ERROR and FATAL messages would continue to be delivered.
<Console name="console"> <PatternLayout pattern="%-5p %d{dd-MMM-yyyy HH:mm:ss} %x %t %m%n"/> <Filters> <BurstFilter level="INFO" rate="16" maxBurst="100"/> </Filters> </Console>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
Sets the logging level to use. |
||
|
|
Sets the maximum number of events that can occur before events are filtered for exceeding the average rate. |
|
|
Sets the Result to return when the filter matches. Defaults to Result. NEUTRAL. |
||
|
Sets the Result to return when the filter does not match. The default is Result. DENY. |
||
|
|
Sets the average number of events per second to allow. |
Filters
- Class
-
org.apache.logging.log4j.core.filter.CompositeFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Composes and invokes one or more filters.
DenyAllFilter
- Class
-
org.apache.logging.log4j.core.filter.DenyAllFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter causes all logging events to be dropped.
DynamicThresholdFilter
- Class
-
org.apache.logging.log4j.core.filter.DynamicThresholdFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Compares against a log level that is associated with a context value.
By default the context is the org.apache.logging.log4j.ThreadContext
, but users may configure a custom org.apache.logging.log4j.core.ContextDataInjector
which obtains context data from some other source.
XML snippet
<DynamicThresholdFilter defaultThreshold=""
key=""
onMatch=""
onMismatch="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</DynamicThresholdFilter>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|||
|
|
||
|
Sets the Result to return when the filter matches. Defaults to Result. NEUTRAL. |
||
|
Sets the Result to return when the filter does not match. The default is Result. DENY. |
org.apache.logging.log4j.core.filter.Filterable
- Class
-
org.apache.logging.log4j.core.filter.Filterable
- Provider
-
org.apache.logging.log4j:log4j-core
Interface implemented by Classes that allow filtering to occur.
Extends LifeCycle since filters have a life cycle.
LevelMatchFilter
- Class
-
org.apache.logging.log4j.core.filter.LevelMatchFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the onMatch result if the logging level in the event matches the specified logging level exactly.
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
Sets the logging level to use. |
||
|
Sets the Result to return when the filter matches. Defaults to Result. NEUTRAL. |
||
|
Sets the Result to return when the filter does not match. The default is Result. DENY. |
LevelRangeFilter
- Class
-
org.apache.logging.log4j.core.filter.LevelRangeFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the LevelRangeFilter result if the level of the org.apache.logging.log4j.core.LogEvent
is in the range of the configured LevelRangeFilter and LevelRangeFilter values, otherwise it returns the LevelRangeFilter result.
The default values for LevelRangeFilter and LevelRangeFilter are set to Level and Level, respectively.
The default values for LevelRangeFilter and LevelRangeFilter are set to org.apache.logging.log4j.core.filter.Result#NEUTRAL
and org.apache.logging.log4j.core.filter.Result#DENY
, respectively.
The levels get compared by their associated integral values; Level has an integral value of 0, Level 100, Level 200, and so on.
For example, if the filter is configured with LevelRangeFilter set to Level, the filter will return LevelRangeFilter result for org.apache.logging.log4j.core.LogEvent
s of level with higher integral values; Level, Level, etc.
MapFilter
- Class
-
org.apache.logging.log4j.core.filter.MapFilter
- Provider
-
org.apache.logging.log4j:log4j-core
A Filter that operates on a Map.
XML snippet
<MapFilter onMatch=""
onMismatch=""
operator="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</MapFilter>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|||
|
|||
|
|
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
MarkerFilter
- Class
-
org.apache.logging.log4j.core.filter.MarkerFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the onMatch result if the marker in the LogEvent is the same as or has the configured marker as a parent.
MutableThreadContextMapFilter
- Class
-
org.apache.logging.log4j.core.filter.MutableThreadContextMapFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Filter based on a value in the Thread Context Map (MDC).
XML snippet
<MutableThreadContextMapFilter configLocation=""
onMatch=""
onMismatch=""
pollInterval=""/>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
Sets the configuration to use. |
|
|
Sets the Result to return when the filter matches. Defaults to Result. NEUTRAL. |
||
|
Sets the Result to return when the filter does not match. The default is Result. DENY. |
||
|
|
Set the frequency in seconds that changes to the list a ThreadContext valudes should be checked. |
NoMarkerFilter
- Class
-
org.apache.logging.log4j.core.filter.NoMarkerFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the onMatch result if there is no marker in the LogEvent.
RegexFilter
- Class
-
org.apache.logging.log4j.core.filter.RegexFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the onMatch result if the message matches the regular expression.
The "useRawMsg" attribute can be used to indicate whether the regular expression should be applied to the result of calling Message. getMessageFormat (true) or Message. getFormattedMessage() (false). The default is false.
XML snippet
<RegexFilter onMatch=""
onMismatch=""
regex=""
useRawMsg="">
<a-String-implementation/><!-- multiple occurrences allowed -->
</RegexFilter>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
The action to perform when a match occurs. |
||
|
The action to perform when a mismatch occurs. |
||
|
|
The regular expression to match. |
|
|
|
If true, the raw message will be used, otherwise the formatted message will be used. |
StringMatchFilter
- Class
-
org.apache.logging.log4j.core.filter.StringMatchFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the onMatch result if the message in the event matches the specified text exactly.
StructuredDataFilter
- Class
-
org.apache.logging.log4j.core.filter.StructuredDataFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Filter based on data in a StructuredDataMessage.
XML snippet
<StructuredDataFilter onMatch=""
onMismatch=""
operator="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</StructuredDataFilter>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
The action to perform on a match. |
||
|
The action to perform on a mismatch. |
||
|
|
The operator to perform. If not "or" the operation will be an "and". |
ThreadContextMapFilter
- Class
-
org.apache.logging.log4j.core.filter.ThreadContextMapFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Filter based on a value in the Thread Context Map (MDC).
XML snippet
<ThreadContextMapFilter onMatch=""
onMismatch=""
operator="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</ThreadContextMapFilter>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
Sets the Result to return when the filter matches. Defaults to Result. NEUTRAL. |
||
|
Sets the Result to return when the filter does not match. The default is Result. DENY. |
||
|
|
ThresholdFilter
- Class
-
org.apache.logging.log4j.core.filter.ThresholdFilter
- Provider
-
org.apache.logging.log4j:log4j-core
This filter returns the onMatch result if the level in the org.apache.logging.log4j.core.LogEvent
is the same or more specific than the configured level and the onMismatch
value otherwise.
For example, if the ThresholdFilter is configured with Level ERROR
and the LogEvent contains Level DEBUG
then the onMismatch
value will be returned since ERROR
events are more specific than DEBUG
.
The default Level is ERROR
.
TimeFilter
- Class
-
org.apache.logging.log4j.core.filter.TimeFilter
- Provider
-
org.apache.logging.log4j:log4j-core
Filters events that fall within a specified time period in each day.
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
Sets the Result to return when the filter matches. Defaults to Result. NEUTRAL. |
||
|
Sets the Result to return when the filter does not match. The default is Result. DENY. |
||
|
|
||
|
|
org.apache.logging.log4j.core.layout.AbstractLayout
- Class
-
org.apache.logging.log4j.core.layout.AbstractLayout
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract base class for Layouts.
org.apache.logging.log4j.core.layout.AbstractStringLayout
- Class
-
org.apache.logging.log4j.core.layout.AbstractStringLayout
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract base class for Layouts that result in a String.
Since 2.4.1, this class has custom logic to convert ISO-8859-1 or US-ASCII Strings to byte[] arrays to improve performance: all characters are simply cast to bytes.
org.apache.logging.log4j.core.layout.Encoder
- Class
-
org.apache.logging.log4j.core.layout.Encoder
- Provider
-
org.apache.logging.log4j:log4j-core
Objects implementing the Encoder
interface know how to convert an object to some binary representation and write the result to a ByteBuffer
, ideally without creating temporary objects.
HtmlLayout
- Class
-
org.apache.logging.log4j.core.layout.HtmlLayout
- Provider
-
org.apache.logging.log4j:log4j-core
Outputs events as rows in an HTML table on an HTML page.
Appenders using this layout should have their encoding set to UTF-8 or UTF-16, otherwise events containing non ASCII characters could result in corrupted log files.
XML snippet
<HtmlLayout charset=""
contentType=""
datePattern=""
fontName=""
fontSize=""
locationInfo=""
timezone=""
title=""/>
org.apache.logging.log4j.core.layout.HtmlLayout.FontSize
- Class
-
org.apache.logging.log4j.core.layout.HtmlLayout.FontSize
- Provider
-
org.apache.logging.log4j:log4j-core
Possible font sizes
LevelPatternSelector
- Class
-
org.apache.logging.log4j.core.layout.LevelPatternSelector
- Provider
-
org.apache.logging.log4j:log4j-core
Selects the pattern to use based on the Level in the LogEvent.
XML snippet
<LevelPatternSelector alwaysWriteExceptions=""
defaultPattern=""
disableAnsi=""
noConsoleNoAnsi="">
<PatternMatch/><!-- multiple occurrences allowed -->
</LevelPatternSelector>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
LoggerFields
- Class
-
org.apache.logging.log4j.core.layout.LoggerFields
- Provider
-
org.apache.logging.log4j:log4j-core
A LoggerFields container.
XML snippet
<LoggerFields discardIfAllFieldsAreEmpty=""
enterpriseId=""
sdId="">
<KeyValuePair/><!-- multiple occurrences allowed -->
</LoggerFields>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
this SD-ELEMENT should be discarded if all fields are empty |
|
|
|
The IANA assigned enterprise number |
|
|
|
The SD-ID in an SD-ELEMENT |
MarkerPatternSelector
- Class
-
org.apache.logging.log4j.core.layout.MarkerPatternSelector
- Provider
-
org.apache.logging.log4j:log4j-core
Selects the pattern to use based on the Marker in the LogEvent.
XML snippet
<MarkerPatternSelector alwaysWriteExceptions=""
defaultPattern=""
disableAnsi=""
noConsoleNoAnsi="">
<PatternMatch/><!-- multiple occurrences allowed -->
</MarkerPatternSelector>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
PatternLayout
- Class
-
org.apache.logging.log4j.core.layout.PatternLayout
- Provider
-
org.apache.logging.log4j:log4j-core
A flexible layout configurable with pattern string.
The goal of this class is to format a org.apache.logging.log4j.core.LogEvent
and return the results.
The format of the result depends on the conversion pattern.
The conversion pattern is closely related to the conversion pattern of the printf function in C. A conversion pattern is composed of literal text and format control expressions called conversion specifiers.
See the Log4j Manual for details on the supported pattern converters.
XML snippet
<PatternLayout alwaysWriteExceptions=""
charset=""
disableAnsi=""
footer=""
header=""
noConsoleNoAnsi=""
pattern="">
<a-PatternSelector-implementation/>
<Replace/>
</PatternLayout>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
PatternMatch
- Class
-
org.apache.logging.log4j.core.layout.PatternMatch
- Provider
-
org.apache.logging.log4j:log4j-core
PatternMatch configuration item.
org.apache.logging.log4j.core.layout.PatternSelector
- Class
-
org.apache.logging.log4j.core.layout.PatternSelector
- Provider
-
org.apache.logging.log4j:log4j-core
Allows different patterns to be used with the PatternLayout based on some selection criteria.
Rfc5424Layout
- Class
-
org.apache.logging.log4j.core.layout.Rfc5424Layout
- Provider
-
org.apache.logging.log4j:log4j-core
Formats a log event in accordance with RFC 5424.
XML snippet
<Rfc5424Layout appName=""
charset=""
ein=""
enterpriseNumber=""
escapeNL=""
eventPrefix=""
exceptionPattern=""
excludes=""
facility=""
footer=""
header=""
id=""
includeMDC=""
includeNL=""
includes=""
mdcId=""
mdcPrefix=""
messageId=""
required=""
useTLSMessageFormat="">
<a-Serializer-implementation/>
<LoggerFields/><!-- multiple occurrences allowed -->
</Rfc5424Layout>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
SyslogLayout
- Class
-
org.apache.logging.log4j.core.layout.SyslogLayout
- Provider
-
org.apache.logging.log4j:log4j-core
Formats a log event as a BSD Log record.
XML snippet
<SyslogLayout charset=""
facility=""
footer=""
header=""
newLine=""
newLineEscape="">
<a-Serializer-implementation/>
</SyslogLayout>
org.apache.logging.log4j.core.lookup.AbstractConfigurationAwareLookup
- Class
-
org.apache.logging.log4j.core.lookup.AbstractConfigurationAwareLookup
- Provider
-
org.apache.logging.log4j:log4j-core
StrLookup that is ConfigurationAware.
Handles saving the Configuration.
org.apache.logging.log4j.core.lookup.AbstractLookup
- Class
-
org.apache.logging.log4j.core.lookup.AbstractLookup
- Provider
-
org.apache.logging.log4j:log4j-core
A default lookup for others to extend.
ctx
- Class
-
org.apache.logging.log4j.core.lookup.ContextMapLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up keys from the context.
By default this is the org.apache.logging.log4j.ThreadContext
, but users may configure a custom org.apache.logging.log4j.core.ContextDataInjector
which obtains context data from some other source.
date
- Class
-
org.apache.logging.log4j.core.lookup.DateLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the current date or the date in the LogEvent.
The "key" is used as the format String, following the java. text. SimpleDateFormat date and time pattern strings.
env
- Class
-
org.apache.logging.log4j.core.lookup.EnvironmentLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up keys from environment variables.
event
- Class
-
org.apache.logging.log4j.core.lookup.EventLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up values from the log event.
java
- Class
-
org.apache.logging.log4j.core.lookup.JavaLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up keys related to Java: Java version, JRE version, VM version, and so on.
jvmrunargs
- Class
-
org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Maps JVM input arguments (but not main arguments) using JMX to acquire JVM arguments.
log4j
- Class
-
org.apache.logging.log4j.core.lookup.Log4jLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Lookup properties of Log4j
lower
- Class
-
org.apache.logging.log4j.core.lookup.LowerLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Converts values to lower case.
The passed in "key" should be the value of another lookup.
main
- Class
-
org.apache.logging.log4j.core.lookup.MainMapLookup
- Provider
-
org.apache.logging.log4j:log4j-core
A map-based lookup for main arguments.
See MainMapLookup)[].
map
- Class
-
org.apache.logging.log4j.core.lookup.MapLookup
- Provider
-
org.apache.logging.log4j:log4j-core
A map-based lookup.
marker
- Class
-
org.apache.logging.log4j.core.lookup.MarkerLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks-up markers.
bundle
- Class
-
org.apache.logging.log4j.core.lookup.ResourceBundleLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up keys from resource bundles.
org.apache.logging.log4j.core.lookup.StrLookup
- Class
-
org.apache.logging.log4j.core.lookup.StrLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Lookup a String key to a String value.
This class represents the simplest form of a string to string map. It has a benefit over a map in that it can create the result on demand based on the key.
For example, it would be possible to implement a lookup that used the key as a primary key, and looked up the value on demand from the database
sd
- Class
-
org.apache.logging.log4j.core.lookup.StructuredDataLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up keys from org.apache.logging.log4j.core.lookup.org.apache.logging.log4j.message.StructuredDataMessage
log messages.
sys
- Class
-
org.apache.logging.log4j.core.lookup.SystemPropertiesLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Looks up keys from system properties.
upper
- Class
-
org.apache.logging.log4j.core.lookup.UpperLookup
- Provider
-
org.apache.logging.log4j:log4j-core
Converts values to upper case.
The passed in "key" should be the value of another lookup.
org.apache.logging.log4j.core.net.Advertiser
- Class
-
org.apache.logging.log4j.core.net.Advertiser
- Provider
-
org.apache.logging.log4j:log4j-core
org.apache.logging.log4j.core.net.Facility
- Class
-
org.apache.logging.log4j.core.net.Facility
- Provider
-
org.apache.logging.log4j:log4j-core
The facility codes used by the Syslog system.
Numerical Code |
Facility |
---|---|
Facility |
0 |
kernel messages |
1 |
user-level messages |
2 |
mail system |
3 |
system daemons |
4 |
security/authorization messages |
5 |
messages generated internally by syslogd |
6 |
line printer subsystem |
7 |
network news subsystem |
8 |
UUCP subsystem |
9 |
clock daemon |
10 |
security/authorization messages |
11 |
FTP daemon |
12 |
NTP subsystem |
13 |
log audit |
14 |
log alert |
15 |
clock daemon (note 2) |
16 |
local use 0 (local0) |
17 |
local use 1 (local1) |
18 |
local use 2 (local2) |
19 |
local use 3 (local3) |
20 |
local use 4 (local4) |
21 |
local use 5 (local5) |
22 |
local use 6 (local6) |
23 |
MulticastDns
- Class
-
org.apache.logging.log4j.core.net.MulticastDnsAdvertiser
- Provider
-
org.apache.logging.log4j:log4j-core
Advertise an entity via ZeroConf/MulticastDNS and the JmDNS library.
The length of property names and values must be 255 bytes or less. Entries with names or values larger than 255 bytes will be removed prior to advertisement.
org.apache.logging.log4j.core.net.Protocol
- Class
-
org.apache.logging.log4j.core.net.Protocol
- Provider
-
org.apache.logging.log4j:log4j-core
Enumerates the supported protocols.
org.apache.logging.log4j.core.net.Rfc1349TrafficClass
- Class
-
org.apache.logging.log4j.core.net.Rfc1349TrafficClass
- Provider
-
org.apache.logging.log4j:log4j-core
Enumerates the RFC 1349 TOS field.
-
IPTOS_LOWCOST (0x02)
-
IPTOS_RELIABILITY (0x04)
-
IPTOS_THROUGHPUT (0x08)
-
IPTOS_LOWDELAY (0x10)
*
SocketAddress
- Class
-
org.apache.logging.log4j.core.net.SocketAddress
- Provider
-
org.apache.logging.log4j:log4j-core
Plugin to hold a hostname and port (socket address).
SocketOptions
- Class
-
org.apache.logging.log4j.core.net.SocketOptions
- Provider
-
org.apache.logging.log4j:log4j-core
Holds all socket options settable via java.net.Socket
methods.
XML snippet
<SocketOptions keepAlive=""
oobInline=""
receiveBufferSize=""
reuseAddress=""
rfc1349TrafficClass=""
sendBufferSize=""
soLinger=""
soTimeout=""
tcpNoDelay=""
trafficClass="">
<SocketPerformancePreferences/>
</SocketOptions>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
SocketPerformancePreferences
- Class
-
org.apache.logging.log4j.core.net.SocketPerformancePreferences
- Provider
-
org.apache.logging.log4j:log4j-core
Holds all socket options settable via java.net.Socket#setPerformancePreferences(int,int,int)
.
The java.net.Socket#setPerformancePreferences(int,int,int)
API may not be implemented by a JRE.
org.apache.logging.log4j.core.net.ssl.AbstractKeyStoreConfiguration
- Class
-
org.apache.logging.log4j.core.net.ssl.AbstractKeyStoreConfiguration
- Provider
-
org.apache.logging.log4j:log4j-core
Configuration of the KeyStore
KeyStore
- Class
-
org.apache.logging.log4j.core.net.ssl.KeyStoreConfiguration
- Provider
-
org.apache.logging.log4j:log4j-core
Configuration of the KeyStore
XML snippet
<KeyStore keyManagerFactoryAlgorithm=""
location=""
password=""
passwordEnvironmentVariable=""
passwordFile=""
type=""/>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The standard name of the requested algorithm. See the Java Secure Socket Extension Reference Guide for information about these names. |
|
|
|
The location of the KeyStore, a file path, URL or resource. |
|
|
|
The password to access the KeyStore. |
|
|
|
||
|
|
||
|
|
The KeyStore type, null defaults to |
Ssl
- Class
-
org.apache.logging.log4j.core.net.ssl.SslConfiguration
- Provider
-
org.apache.logging.log4j:log4j-core
SSL Configuration
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The protocol, see SSLContext Algorithms |
org.apache.logging.log4j.core.net.ssl.StoreConfiguration
- Class
-
org.apache.logging.log4j.core.net.ssl.StoreConfiguration
- Provider
-
org.apache.logging.log4j:log4j-core
TrustStore
- Class
-
org.apache.logging.log4j.core.net.ssl.TrustStoreConfiguration
- Provider
-
org.apache.logging.log4j:log4j-core
Configuration of the TrustStore
XML snippet
<TrustStore location=""
password=""
passwordEnvironmentVariable=""
passwordFile=""
trustManagerFactoryAlgorithm=""
type=""/>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The location of the KeyStore, a file path, URL or resource. |
|
|
|
The password to access the KeyStore. |
|
|
|
||
|
|
||
|
|
The standard name of the requested trust management algorithm. See the Java Secure Socket Extension Reference Guide for information these names. |
|
|
|
The KeyStore type, null defaults to |
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.AbstractPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
AbstractPatternConverter is an abstract class that provides the formatting functionality that derived classes need.
Conversion specifiers in a conversion patterns are parsed to individual PatternConverters. Each of which is responsible for converting an object in a converter specific manner.
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
black
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Black
- Provider
-
org.apache.logging.log4j:log4j-core
Black style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
blue
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Blue
- Provider
-
org.apache.logging.log4j:log4j-core
Blue style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
cyan
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Cyan
- Provider
-
org.apache.logging.log4j:log4j-core
Cyan style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
green
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Green
- Provider
-
org.apache.logging.log4j:log4j-core
Green style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
magenta
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Magenta
- Provider
-
org.apache.logging.log4j:log4j-core
Magenta style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
red
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Red
- Provider
-
org.apache.logging.log4j:log4j-core
Red style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
white
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.White
- Provider
-
org.apache.logging.log4j:log4j-core
White style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
yellow
- Class
-
org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter.Yellow
- Provider
-
org.apache.logging.log4j:log4j-core
Yellow style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
org.apache.logging.log4j.core.pattern.AnsiConverter
- Class
-
org.apache.logging.log4j.core.pattern.AnsiConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Marks classes that implement ANSI escape code conversions.
org.apache.logging.log4j.core.pattern.ArrayPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ArrayPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
PatternConverters implement this interface to accept an array of objects when formatting.
ClassNamePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ClassNamePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the class name of the site of the logging request.
DatePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.DatePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts and formats the event’s date in a StringBuilder.
encode
- Class
-
org.apache.logging.log4j.core.pattern.EncodingPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converter that encodes the output from a pattern using a specified format.
Supported formats include HTML (default) and JSON.
EndOfBatchPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.EndOfBatchPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the EndOfBatch.
org.apache.logging.log4j.core.pattern.EqualsBaseReplacementConverter
- Class
-
org.apache.logging.log4j.core.pattern.EqualsBaseReplacementConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Equals pattern converter.
equalsIgnoreCase
- Class
-
org.apache.logging.log4j.core.pattern.EqualsIgnoreCaseReplacementConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Equals ignore case pattern converter.
equals
- Class
-
org.apache.logging.log4j.core.pattern.EqualsReplacementConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Equals pattern converter.
ExtendedThrowablePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
ThrowablePatternConverter variant where the rendered java.lang.StackTraceElement
s are enriched with the enclosing JAR file and its version information, if available.
FileDatePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.FileDatePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats a date by delegating to DatePatternConverter.
The default date pattern for a %d specifier in a file name is different than the %d pattern in pattern layout.
FileLocationPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.FileLocationPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the event’s line location information in a StringBuilder.
FullLocationPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.FullLocationPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Format the event’s line location information.
highlight
- Class
-
org.apache.logging.log4j.core.pattern.HighlightConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Highlight pattern converter.
Formats the result of a pattern using a color appropriate for the Level in the LogEvent.
For example:
%highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}
You can define custom colors for each Level:
%highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=cyan,
TRACE=black}
You can use a predefined style:
%highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}{STYLE=DEFAULT}
The available predefined styles are:
-
Default
-
Log4j
- The same asDefault
-
Logback
You can use whitespace around the comma and equal sign.
The names in values MUST come from the org.apache.logging.log4j.core.pattern.AnsiEscape
enum, case is normalized to upper-case internally.
To disable ANSI output unconditionally, specify an additional option disableAnsi=true
, or to disable ANSI output if no console is detected, specify option noConsoleNoAnsi=true
e.g..
%highlight{%d{ ISO8601 } [%t] %-5level: %msg%n%throwable}{STYLE=DEFAULT, noConsoleNoAnsi=true}
IntegerPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.IntegerPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats an integer.
LevelPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.LevelPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the event’s level in a StringBuilder.
LineLocationPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.LineLocationPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the event’s line location information in a StringBuilder.
LineSeparatorPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.LineSeparatorPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats a line separator.
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.LogEventPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
LoggingEventPatternConverter is a base class for pattern converters that can format information from instances of LoggingEvent.
LoggerFqcnPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.LoggerFqcnPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the Logger FQCN.
LoggerPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.LoggerPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats a logger name.
MapPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.MapPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Able to handle the contents of the LogEvent’s MapMessage and either output the entire contents of the properties in a similar format to the java. util. Hashtable. toString(), or to output the value of a specific key within the Map.
MarkerPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.MarkerPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns events' full marker string in a StringBuilder.
MarkerNamePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.MarkerSimpleNamePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Appends an event’s maker name to a StringBuilder.
maxLength
- Class
-
org.apache.logging.log4j.core.pattern.MaxLengthConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Max length pattern converter.
Limit contained text to a maximum length. On invalid length the default value 100 is used (and an error message is logged). If max length is greater than 20, an abbreviated text will get ellipsis ("…") appended. Example usage (for email subject):
`%maxLen{[AppName, ${hostName}, ${web:contextPath}] %p: %c{1} - %m%notEmpty{ =>%ex{short}}}{160}`
MdcPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.MdcPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Able to handle the contents of the LogEvent’s MDC and either output the entire contents of the properties in a similar format to the java. util. Hashtable. toString(), or to output the value of a specific key within the property bundle when this pattern converter has the option set.
MessagePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.MessagePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the event’s rendered message in a StringBuilder.
MethodLocationPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.MethodLocationPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the event’s line location information in a StringBuilder.
org.apache.logging.log4j.core.pattern.NamePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.NamePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Abstract base class for other pattern converters which can return only parts of their name.
NanoTimePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.NanoTimePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Converts and formats the event’s nanoTime in a StringBuilder.
NdcPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.NdcPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the event’s NDC in a StringBuilder.
org.apache.logging.log4j.core.pattern.PatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.PatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Interface that all PatternConverters must implement.
ProcessIdPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ProcessIdPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Replace
- Class
-
org.apache.logging.log4j.core.pattern.RegexReplacement
- Provider
-
org.apache.logging.log4j:log4j-core
Replace tokens in the LogEvent message.
replace
- Class
-
org.apache.logging.log4j.core.pattern.RegexReplacementConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Replacement pattern converter.
RelativeTimePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.RelativeTimePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Returns the relative time in milliseconds since JVM Startup.
repeat
- Class
-
org.apache.logging.log4j.core.pattern.RepeatPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Equals pattern converter.
RootThrowablePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.RootThrowablePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
ThrowablePatternConverter variant where the stack trace causal chain is rendered in reverse order.
SequenceNumberPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.SequenceNumberPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the event sequence number.
style
- Class
-
org.apache.logging.log4j.core.pattern.StyleConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Style pattern converter.
Adds ANSI color styling to the result of the enclosed pattern.
To disable ANSI output unconditionally, specify an additional option disableAnsi=true
, or to disable ANSI output if no console is detected, specify option noConsoleNoAnsi=true
.
ThreadIdPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ThreadIdPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the event thread ID.
ThreadPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ThreadNamePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the event thread name.
ThreadPriorityPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ThreadPriorityPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the event thread priority.
ThrowablePatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.ThrowablePatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Outputs certain information extracted from the java.lang.Throwable
associated with a org.apache.logging.log4j.core.LogEvent
.
UuidPatternConverter
- Class
-
org.apache.logging.log4j.core.pattern.UuidPatternConverter
- Provider
-
org.apache.logging.log4j:log4j-core
Formats the event sequence number.
notEmpty
- Class
-
org.apache.logging.log4j.core.pattern.VariablesNotEmptyReplacementConverter
- Provider
-
org.apache.logging.log4j:log4j-core
VariablesNotEmpty pattern converter.
org.apache.logging.log4j.core.util.AbstractWatcher
- Class
-
org.apache.logging.log4j.core.util.AbstractWatcher
- Provider
-
org.apache.logging.log4j:log4j-core
Watcher for configuration files.
Causes a reconfiguration when a file changes.
KeyValuePair
- Class
-
org.apache.logging.log4j.core.util.KeyValuePair
- Provider
-
org.apache.logging.log4j:log4j-core
Key/Value pair configuration item.
org.apache.logging.log4j.core.util.Watcher
- Class
-
org.apache.logging.log4j.core.util.Watcher
- Provider
-
org.apache.logging.log4j:log4j-core
Watches for changes in a Source and performs an action when it is modified.
org.apache.logging.log4j.plugins.convert.TypeConverter
- Class
-
org.apache.logging.log4j.plugins.convert.TypeConverter
- Provider
-
org.apache.logging.log4j:log4j-core
org.apache.logging.log4j:log4j-csv
org.apache.commons.csv.QuoteMode
- Class
-
org.apache.commons.csv.QuoteMode
- Provider
-
org.apache.logging.log4j:log4j-csv
org.apache.logging.log4j.csv.layout.AbstractCsvLayout
- Class
-
org.apache.logging.log4j.csv.layout.AbstractCsvLayout
- Provider
-
org.apache.logging.log4j:log4j-csv
A superclass for Comma-Separated Value (CSV) layouts.
Depends on Apache Commons CSV 1.2.
CsvLogEventLayout
- Class
-
org.apache.logging.log4j.csv.layout.CsvLogEventLayout
- Provider
-
org.apache.logging.log4j:log4j-csv
A Comma-Separated Value (CSV) layout to log events.
Depends on Apache Commons CSV 1.2.
XML snippet
<CsvLogEventLayout charset=""
delimiter=""
escape=""
footer=""
format=""
header=""
nullString=""
quote=""
quoteMode=""
recordSeparator=""/>
CsvParameterLayout
- Class
-
org.apache.logging.log4j.csv.layout.CsvParameterLayout
- Provider
-
org.apache.logging.log4j:log4j-csv
A Comma-Separated Value (CSV) layout to log event parameters.
The event message is currently ignored.
Best used with:
logger. debug(new ObjectArrayMessage(1, 2, "Bob"));
Depends on Apache Commons CSV 1.4.
XML snippet
<CsvParameterLayout charset=""
delimiter=""
escape=""
footer=""
format=""
header=""
nullString=""
quote=""
quoteMode=""
recordSeparator=""/>
org.apache.logging.log4j:log4j-jctools
JCToolsBlockingQueue
- Class
-
org.apache.logging.log4j.jctools.JCToolsBlockingQueueFactory
- Provider
-
org.apache.logging.log4j:log4j-jctools
A BlockingQueueFactory based on JCTools.
org.apache.logging.log4j:log4j-jdbc
org.apache.logging.log4j.jdbc.appender.AbstractConnectionSource
- Class
-
org.apache.logging.log4j.jdbc.appender.AbstractConnectionSource
- Provider
-
org.apache.logging.log4j:log4j-jdbc
org.apache.logging.log4j.jdbc.appender.AbstractDriverManagerConnectionSource
- Class
-
org.apache.logging.log4j.jdbc.appender.AbstractDriverManagerConnectionSource
- Provider
-
org.apache.logging.log4j:log4j-jdbc
A ConnectionSource that uses a JDBC connection string, a user name, and a password to call java.sql.DriverManager#getConnection(String,String,String)
.
This plugin does not provide any connection pooling unless it is available through the connection string and driver itself. This handy to get you off the ground without having to deal with JNDI.
Column
- Class
-
org.apache.logging.log4j.jdbc.appender.ColumnConfig
- Provider
-
org.apache.logging.log4j:log4j-jdbc
A configuration element used to configure which event properties are logged to which columns in the database table.
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
The literal value to insert into the column as-is without any quoting or escaping. Mutually exclusive with |
|
|
|
The name of the database column as it exists within the database table. |
|
|
|
The PatternLayout pattern to insert in this column. Mutually exclusive with |
org.apache.logging.log4j.jdbc.appender.ConnectionSource
- Class
-
org.apache.logging.log4j.jdbc.appender.ConnectionSource
- Provider
-
org.apache.logging.log4j:log4j-jdbc
Configuration element for JdbcAppender.
If you want to use the JdbcAppender but none of the provided connection sources meet your needs, you can simply create your own connection source.
DriverManager
- Class
-
org.apache.logging.log4j.jdbc.appender.DriverManagerConnectionSource
- Provider
-
org.apache.logging.log4j:log4j-jdbc
A ConnectionSource that uses a JDBC connection string, a user name, and a password to call java.sql.DriverManager#getConnection(String,String,String)
.
This plugin does not provide any connection pooling unless it is available through the connection string and driver itself. This handy to get you off the ground without having to deal with JNDI.
XML snippet
<DriverManager connectionString=""
driverClassName=""
password=""
userName="">
<Property/><!-- multiple occurrences allowed -->
</DriverManager>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
ConnectionFactory
- Class
-
org.apache.logging.log4j.jdbc.appender.FactoryMethodConnectionSource
- Provider
-
org.apache.logging.log4j:log4j-jdbc
A JdbcAppender connection source that uses a public static factory method to obtain a java.sql.Connection
or javax.sql.DataSource
.
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
The name of a public class that contains a static method capable of returning either a |
|
|
|
The name of the public static method on the aforementioned class that returns the data source or connection.
If this method returns a |
JDBC
- Class
-
org.apache.logging.log4j.jdbc.appender.JdbcAppender
- Provider
-
org.apache.logging.log4j:log4j-jdbc
This Appender writes logging events to a relational database using standard JDBC mechanisms.
It takes a list of ColumnConfigs and/or ColumnMappings with which it determines how to save the event data into the appropriate columns in the table.
ColumnMapping is new as of Log4j 2.8 and supports type conversion and persistence using java.sql.PreparedStatement#setObject(int,Object)
. A ConnectionSource plugin instance instructs the appender (and org.apache.logging.log4j.jdbc.appender.JdbcDatabaseManager
) how to connect to the database.
This appender can be reconfigured at run time.
XML snippet
<JDBC bufferSize=""
ignoreExceptions=""
immediateFail=""
name=""
reconnectIntervalMillis=""
tableName=""
truncateStrings="">
<a-Filter-implementation/>
<a-Layout-implementation/>
<ColumnMapping/><!-- multiple occurrences allowed -->
<Property/><!-- multiple occurrences allowed -->
<Column/><!-- multiple occurrences allowed -->
<a-ConnectionSource-implementation/>
</JDBC>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
If an integer greater than 0, this causes the appender to buffer log events and flush whenever the buffer reaches this size. |
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
The name of the database table to insert log events into. |
|
|
|
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
|
||
|
||
|
Information about the columns that log event data should be inserted into and how to insert that data. |
|
The connections source from which database connections should be retrieved. |
org.apache.logging.log4j:log4j-jdbc-dbcp2
PoolableConnectionFactory
- Class
-
org.apache.logging.log4j.dbcp2.appender.PoolableConnectionFactoryConfig
- Provider
-
org.apache.logging.log4j:log4j-jdbc-dbcp2
Configures an Apache Commons DBCP org.apache.commons.dbcp2.PoolableConnectionFactory
.
XML snippet
<PoolableConnectionFactory autoCommitOnReturn=""
cacheState=""
defaultAutoCommit=""
defaultCatalog=""
defaultQueryTimeoutSeconds=""
defaultReadOnly=""
defaultTransactionIsolation=""
fastFailValidation=""
maxConnLifetimeMillis=""
maxOpenPreparedStatements=""
poolStatements=""
rollbackOnReturn=""
validationQuery=""
validationQueryTimeoutSeconds="">
<a-String-implementation/><!-- multiple occurrences allowed -->
</PoolableConnectionFactory>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
PoolingDriver
- Class
-
org.apache.logging.log4j.dbcp2.appender.PoolingDriverConnectionSource
- Provider
-
org.apache.logging.log4j:log4j-jdbc-dbcp2
A ConnectionSource that uses a JDBC connection string, a user name, and a password to call java.sql.DriverManager#getConnection(String,String,String)
.
The connections are served from an Apache Commons DBCP pooling driver.
XML snippet
<PoolingDriver connectionString=""
driverClassName=""
password=""
poolName=""
userName="">
<Property/><!-- multiple occurrences allowed -->
<PoolableConnectionFactory/>
</PoolingDriver>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
org.apache.logging.log4j:log4j-jdbc-jndi
org.apache.logging.log4j:log4j-layout-template-json
JsonTemplateLayout
- Class
-
org.apache.logging.log4j.layout.template.json.JsonTemplateLayout
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
XML snippet
<JsonTemplateLayout charset=""
eventDelimiter=""
eventTemplate=""
eventTemplateRootObjectKey=""
eventTemplateUri=""
locationInfoEnabled=""
maxStringLength=""
nullEventDelimiterEnabled=""
stackTraceElementTemplate=""
stackTraceElementTemplateUri=""
stackTraceEnabled=""
truncatedStringSuffix="">
<EventTemplateAdditionalField/><!-- multiple occurrences allowed -->
</JsonTemplateLayout>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
EventTemplateAdditionalField
- Class
-
org.apache.logging.log4j.layout.template.json.JsonTemplateLayout.EventTemplateAdditionalField
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.JsonTemplateLayout.EventTemplateAdditionalField.Format
- Class
-
org.apache.logging.log4j.layout.template.json.JsonTemplateLayout.EventTemplateAdditionalField.Format
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
CaseConverterResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.CaseConverterResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.CaseConverterResolver
factory.
CounterResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.CounterResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.CounterResolver
factory.
EndOfBatchResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.EndOfBatchResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.EndOfBatchResolver
factory.
EventAdditionalFieldInterceptor
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.EventAdditionalFieldInterceptor
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
Interceptor to add additional fields after event template read.
org.apache.logging.log4j.layout.template.json.resolver.EventResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.EventResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
TemplateResolverFactory specialized for org.apache.logging.log4j.core.LogEvent
s.
org.apache.logging.log4j.layout.template.json.resolver.EventResolverInterceptor
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.EventResolverInterceptor
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
TemplateResolverInterceptor specialized for org.apache.logging.log4j.core.LogEvent
s.
EventRootObjectKeyInterceptor
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.EventRootObjectKeyInterceptor
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
Interceptor to add a root object key to the event template.
ExceptionResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.ExceptionResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.ExceptionResolver
factory.
ExceptionRootCauseResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.ExceptionRootCauseResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.ExceptionRootCauseResolver
factory.
LevelResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.LevelResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.LevelResolver
factory.
LoggerResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.LoggerResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.LoggerResolver
factory.
MainMapResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.MainMapResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.MainMapResolver
factory.
MapResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.MapResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.MapResolver
factory.
MarkerResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.MarkerResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.MarkerResolver
factory.
MessageParameterResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.MessageParameterResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.MessageParameterResolver
factory.
MessageResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.MessageResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
A org.apache.logging.log4j.layout.template.json.resolver.MessageResolver
factory.
PatternResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.PatternResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.PatternResolver
factory.
SourceResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.SourceResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.SourceResolver
factory.
org.apache.logging.log4j.layout.template.json.resolver.TemplateResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.TemplateResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.TemplateResolver
factory.
org.apache.logging.log4j.layout.template.json.resolver.TemplateResolverInterceptor
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.TemplateResolverInterceptor
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
Main org.apache.logging.log4j.layout.template.json.resolver.TemplateResolver
compilation interception interface.
ThreadContextDataResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.ThreadContextDataResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.ThreadContextDataResolver
factory.
ThreadContextStackResolverFactory
- Class
-
org.apache.logging.log4j.layout.template.json.resolver.ThreadContextStackResolverFactory
- Provider
-
org.apache.logging.log4j:log4j-layout-template-json
org.apache.logging.log4j.layout.template.json.resolver.ThreadContextStackResolver
factory.
org.apache.logging.log4j:log4j-mongodb
org.apache.logging.log4j.core.appender.nosql.NoSqlProvider
- Class
-
org.apache.logging.log4j.core.appender.nosql.NoSqlProvider
- Provider
-
org.apache.logging.log4j:log4j-mongodb
MongoDb
- Class
-
org.apache.logging.log4j.mongodb.MongoDbProvider
- Provider
-
org.apache.logging.log4j:log4j-mongodb
The MongoDB implementation of NoSqlProvider using the MongoDB driver version 5 API.
XML snippet
<MongoDb capped=""
collectionSize=""
connection="">
<a-Filter-implementation/>
<Property/><!-- multiple occurrences allowed -->
</MongoDb>
org.apache.logging.log4j:log4j-plugins-test
org.apache.logging.log4j.plugins.test.validation.AbstractPluginWithGenericBuilder
- Class
-
org.apache.logging.log4j.plugins.test.validation.AbstractPluginWithGenericBuilder
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
Fake
- Class
-
org.apache.logging.log4j.plugins.test.validation.FakePlugin
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
Test plugin class for unit tests.
Nested
- Class
-
org.apache.logging.log4j.plugins.test.validation.FakePlugin.Nested
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
HostAndPort
- Class
-
org.apache.logging.log4j.plugins.test.validation.HostAndPort
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
PluginWithGenericSubclassFoo1Builder
- Class
-
org.apache.logging.log4j.plugins.test.validation.PluginWithGenericSubclassFoo1Builder
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
Validator
- Class
-
org.apache.logging.log4j.plugins.test.validation.ValidatingPlugin
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
ValidatingPluginWithGenericBuilder
- Class
-
org.apache.logging.log4j.plugins.test.validation.ValidatingPluginWithGenericBuilder
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
ValidatingPluginWithTypedBuilder
- Class
-
org.apache.logging.log4j.plugins.test.validation.ValidatingPluginWithTypedBuilder
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
Alpha
- Class
-
org.apache.logging.log4j.plugins.test.validation.di.AlphaBean
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
org.apache.logging.log4j.plugins.test.validation.di.BaseBean
- Class
-
org.apache.logging.log4j.plugins.test.validation.di.BaseBean
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
Beta
- Class
-
org.apache.logging.log4j.plugins.test.validation.di.BetaBean
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
configurable
- Class
-
org.apache.logging.log4j.plugins.test.validation.di.ConfigurablePlugin
- Provider
-
org.apache.logging.log4j:log4j-plugins-test
org.apache.logging.log4j:log4j-script
org.apache.logging.log4j.core.script.Script
- Class
-
org.apache.logging.log4j.core.script.Script
- Provider
-
org.apache.logging.log4j:log4j-script
org.apache.logging.log4j.core.script.ScriptConditional
- Class
-
org.apache.logging.log4j.core.script.ScriptConditional
- Provider
-
org.apache.logging.log4j:log4j-script
org.apache.logging.log4j.script.AbstractScript
- Class
-
org.apache.logging.log4j.script.AbstractScript
- Provider
-
org.apache.logging.log4j:log4j-script
Container for the language and body of a script.
ScriptFile
- Class
-
org.apache.logging.log4j.script.ScriptFile
- Provider
-
org.apache.logging.log4j:log4j-script
Container for the language and body of a script file along with the file location.
Script
- Class
-
org.apache.logging.log4j.script.ScriptPlugin
- Provider
-
org.apache.logging.log4j:log4j-script
Container for the language and body of a script.
ScriptRef
- Class
-
org.apache.logging.log4j.script.ScriptRef
- Provider
-
org.apache.logging.log4j:log4j-script
Contains a reference to a script defined elsewhere in the configuration.
Scripts
- Class
-
org.apache.logging.log4j.script.ScriptsPlugin
- Provider
-
org.apache.logging.log4j:log4j-script
A container of Scripts.
ScriptAppenderSelector
- Class
-
org.apache.logging.log4j.script.appender.ScriptAppenderSelector
- Provider
-
org.apache.logging.log4j:log4j-script
XML snippet
<ScriptAppenderSelector name="">
<AppenderSet/>
<a-AbstractScript-implementation/>
</ScriptAppenderSelector>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
ScriptCondition
- Class
-
org.apache.logging.log4j.script.appender.rolling.action.ScriptCondition
- Provider
-
org.apache.logging.log4j:log4j-script
A condition of the org.apache.logging.log4j.script.appender.rolling.action.DeleteAction
where a user-provided script selects the files to delete from a provided list.
The specified script may be a Script, a org.apache.logging.log4j.script.appender.rolling.action.ScriptFile
or a ScriptRef.
Nested components
Optional components are denoted by ?
-suffixed types.
Tag | Type | Description |
---|---|---|
The script to run.
This may be a Script, a
|
ScriptArbiter
- Class
-
org.apache.logging.log4j.script.config.arbiter.ScriptArbiter
- Provider
-
org.apache.logging.log4j:log4j-script
Condition that evaluates a script.
ScriptFilter
- Class
-
org.apache.logging.log4j.script.filter.ScriptFilter
- Provider
-
org.apache.logging.log4j:log4j-script
Returns the onMatch result if the script returns True and returns the onMismatch value otherwise.
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
The action to take if a match occurs. |
||
|
The action to take if no match occurs. |
ScriptPatternSelector
- Class
-
org.apache.logging.log4j.script.layout.ScriptPatternSelector
- Provider
-
org.apache.logging.log4j:log4j-script
Selects the pattern to use based on the result of executing a Script.
The returned value will be used as the "key" to choose between one of the configured patterns. If no key is returned or there is no match the default pattern will be used.
XML snippet
<ScriptPatternSelector alwaysWriteExceptions=""
defaultPattern=""
disableAnsi=""
noConsoleNoAnsi="">
<PatternMatch/><!-- multiple occurrences allowed -->
<a-AbstractScript-implementation/>
</ScriptPatternSelector>
Attributes
Optional attributes are denoted by ?
-suffixed types.
Name | Type | Default | Description |
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|