15.3.2. Configuring audit logging appenders
Apache Log4j provides different appenders that you can use to send audit messages to a destination other than the default log file. For instance, if you want to send audit logs to a syslog daemon, JDBC database, or Apache Kafka server, you can configure an appender in log4j2.xml.
Procedure
-
Open
$RHDG_HOME/server/conf/log4j2.xmlwith any text editor. Comment or remove the default
AUDIT-FILErolling file appender.<!--RollingFile name="AUDIT-FILE" ... </RollingFile-->Add the desired logging appender for audit messages.
For example, you could add a logging appender for a Kafka server as follows:
<Kafka name="AUDIT-KAFKA" topic="audit"> <PatternLayout pattern="%date %message"/> <Property name="bootstrap.servers">localhost:9092</Property> </Kafka>-
Save and close
log4j2.xml.