Issue
-
ActiveFileName
attribute is not recognized when migrating a custom portal-log4j-ext.xml from DXP 7.2 to DXP 7.4.
Environment
- DXP 7.4
Resolution
- DXP 7.4 uses Log4j 2 whereas DXP 7.2 uses Log4j 1. While DXP 7.4 has a compatibility layer that allows Log4j 1 configurations to still be usable, this compatibility layer does not have handling for ActiveFileName.
- It would be recommended to migrate the Log4j 1 configuration to new Log4j 2 configuration format.
- The Log4j 2 equivalent for
ActiveFileName
attribute would be theFileName
attribute for RollingFileAppender - Please feel free to refer to the following Log4j 2 sample below:
POC: portal-log4j-ext.xml
<?xml version="1.0"?> <Configuration strict="true"> <Appenders> <Appender fileName="@liferay.home@/tomcat-9.0.71/logs/authutil.log" filePattern="@liferay.home@/tomcat-9.0.71/logs/authutil.log.%d{yyyy-MM-dd-HH}" name="AUTHUTILAPPR" type="RollingFile"> <Layout pattern="[%t] %d{DATE} %5p %C{1}:%L - %m%n" type="PatternLayout" /> <TimeBasedTriggeringPolicy /> </Appender> </Appenders> <Loggers> <Logger name="AUTHUTIL" level="ALL"> <AppenderRef ref="AUTHUTILAPPR"/> </Logger> </Loggers> </Configuration>
Additional Information
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In