Apache log4j logo Apache logging services logo

The Apache Log4j Audit Sample Project

Log4j-Audit has a companion sample project at https://github.com/apache/logging-log4j-audit-sample. This project contains 3 modules that are described in the following sections. Developers may clone this project and use it as the basis for their own auditing projects

Audit Service API

The Audit Service API module contains the JSON catalog file that is used to generate the audit event Interfaces. After running the build the generated Java source files will reside in the target/generated-source/log4j-audit directory. All the classes will be in the org.apache.logging.log4j.audit.event package.

Audit Service WAR

The Audit Service WAR module builds a REST application that can be deployed to a servlet container. The REST application provides endpoints to perform audit logging for remote and non-Java applications as well as endpoints to create, read, update and delete dynamic catalog entries.

Sample Application

As its name implies, the sample application module provides a minimal sample application that demonstrates how audit logging may be performed. Because this is a standalone application instead of a web application, initialization of the RequestContext does not match how it would typically be done when integrated into a web application.