How Geode Logging Works

Apache Geode uses Apache Log4j 2 as the basis for its logging system.

Geode uses Apache Log4j 2 API and Core libraries as the basis for its logging system. Log4j 2 API is a popular and powerful front-end logging API used by all the Geode classes to generate log statements. Log4j 2 Core is a backend implementation for logging; you can route any of the front-end logging API libraries to log to this backend. Geode uses the Core backend to run two custom Log4j 2 Appenders: AlertAppender and LogWriterAppender.

Geode has been tested with Log4j 2.1.

Note:
For this reason, Geode now always requires the following JARs to be in the classpath: log4j-api-2.1.jar, log4j-core-2.1.jar. Both of these JARs are distributed in the $GEMFIRE/lib directory and included in the appropriate *-dependencies.jar convenience libraries.

AlertAppender is the component that generates Geode alerts that are then managed by the JMX Management and Monitoring system. See Notification Federation for more details.

LogWriterAppender is the component that is configured by all the log-* Geode properties such as log-file, log-file-size-limit and log-disk-space-limit.

Both of these appenders are created and controlled programmatically. You configure their behavior with the log-* Geode properties and the alert level that is configured within the JMX Management & Monitoring system. These appenders do not currently support configuration within a log4j2.xml config file.