Legacy Knowledge Base
Published Sep. 10, 2025

How can I disable Liferay's xml log file?

Written By

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • In {Liferay_Home}/log folder, we can see two different files as below:
         liferay.2019-08-25.log
         liferay.2019-08-25.xml
    We only want "liferay.2019-08-25.log" file and need to disable "xml" file.

Environment

  • Liferay DXP 7.0
  • Liferay DXP 7.1
  • Liferay DXP 7.2
  • Liferay DXP 7.3
  • Liferay DXP 7.4

Resolution

Liferay DXP 7.0 to 7.3:

  1. Extract portal-log4j.xml from /ROOT/WEB-INF/lib/portal-impl.jar/META-INF
  2. Copy the file to /ROOT/WEB-INF/classes/META-INF/
  3. Comment out or remove the line at the bottom of the file:
     <appender-ref ref="XML_FILE" />
  4. Restart server 

Liferay DXP 7.4:

  1. Extract portal-log4j.xml from /ROOT/WEB-INF/shielded-container-lib/portal-impl.jar/META-INF
  2. Copy the file to /ROOT/WEB-INF/classes/META-INF/
  3. Rename de file to portal-log4j-ext.xml
  4. In this case it is not enough to remove the appender because if there is no property, the one that exists in the portal-loj4j.xml file will be used. So in addition to removing that appender, you have to override it with a null value so it doesn't get created. Add this line to de appenders section at the top of the file:
     <Null name="XML_FILE" />
  5. Comment out or remove the following section 
     <Appender filePattern="@liferay.home@/logs/liferay.%d{yyyy-MM-dd}.xml" ignoreExceptions="false" name="XML_FILE" type="RollingFile">
    <Log4j1XmlLayout locationInfo="true" />
    <TimeBasedTriggeringPolicy />
    <DirectWriteRolloverStrategy />
    </Appender>
  6. Comment out or remove the line at the bottom of the file:
     <appender-ref ref="XML_FILE" />
  7. Restart the server.
Did this article resolve your issue ?

Legacy Knowledge Base