Issue
- Audit log files are not generated despite following the steps as shown in: https://help.liferay.com/hc/en-us/articles/360029134891-Configuring-Audits#reporting-audit-events-in-liferays-logs-and-console
- This is due to portal-log4j-ext.xml file not conforming with newer log4j 2.x syntax.
Environment
- DXP 7.4
Resolution
- Create a portal-log4j-ext.xml file containing the following:
<Configuration strict="true">
<Appenders>
<Appender filePattern="@liferay.home@/logs/audit.%d{yyyy-MM-dd}.log" ignoreExceptions="false" name="AUDIT_FILE" type="RollingFile">
<Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t][%c{1}:%L] %m%n" type="PatternLayout"/>
<TimeBasedTriggeringPolicy/>
<DirectWriteRolloverStrategy/>
</Appender>
</Appenders>
<Loggers>
<Logger level="INFO" name="com.liferay.portal.security.audit.router.internal.LoggingAuditMessageProcessor" additivity="false">
<AppenderRef ref="AUDIT_FILE"/>
</Logger>
</Loggers>
</Configuration>
- Add the file to the following address:
Liferay Home]/tomcat-[version]/webapps/ROOT/WEB-INF/classes/META-INF -
Enable Audit logging through Control Panel→ System Settings → Audit
Additional Information