Adding audit appender to log4j configuration

The audit appender is added to the log4j.properties file to configure the creation of audit logs. The audit appender logs all events at the INFO level. Therefore, log4j.logger.com.workbrain.security.AuditLogService must be set to the INFO level or lower for the audit logs to be created.

This is an example configuration for the audit log appender that is appropriate for an on-premises deployment. This example uses a rolling file appender to create the audit.log file in the directory specified in the -Dlog.dir Java variable.
log4j.logger.com.workbrain.security.AuditLogService=DEBUG, audit
log4j.appender.audit=org.apache.log4j.RollingFileAppender
log4j.appender.audit.File=${log.dir}/audit.log
log4j.appender.audit.MaxBackupIndex=10
log4j.appender.audit.MaxFileSize=10MB
log4j.appender.audit.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.audit.layout.ConversionPattern=[AUDIT] %5p %d{yyyy-MM-dd'T'HH:mm:ssX}{GMT}, %m%n

The appender configuration does not determine how long logs are retained. Separate methods must be implemented to satisfy requirements around the retention of the logs.