How can I disable Liferay's xml log file?

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 line at the bottom of the file:
     <appender-ref ref="XML_FILE" />
  6. Restart the server.

 

 

 

这篇文章有帮助吗?
3 人中有 2 人觉得有帮助