Legacy Knowledge Base
Published Sep. 10, 2025

Adjusting Log Levels to persist after portal restart

Written By

Katlyn Lee

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

  • Log levels that have been adjusted through the Server Administration are reset after a server restart. I'd like the log levels adjustments to persist after restarts.

Environment

  • DXP 7.0+

Resolution

  • Adjust log levels using a portal-log4j-ext.xml file. Please note that this method works only for classes from the core portal implementation portal-impl. To override the default log level of a class in a specific OSGi module, please see https://help.liferay.com/hc/en-us/articles/360018168751-Adjusting-Module-Logging.

    1. Find and open up portal-impl.jar:
      • Path for 7.3 and before: webapps/ROOT/WEB-INF/lib/ 
      • Path for 7.4 and later: webapps/ROOT/WEB-INF/shielded-container-lib/
    2. Inside portal-impl.jar, navigate to the META-INF folder.
    3. Copy the portal-log4j.xml file to webapps/ROOT/WEB-INF/classes/META-INF.
    4. Navigate to webapps/ROOT/WEB-INF/classes/META-INF, and rename the copied portal-log4j.xml file toportal-log4j-ext.xml.
    5. Open up the file and modify the priority levels of the categories as desired. Note that Log4j2 is used from 7.4. For example, if you'd like to add DEBUG logs for com.liferay.portal.events.LoginPreAction, change the category's priority level like the following:
      • 7.3 and before
        <category name="com.liferay.portal.events.LoginPreAction">
            <priority value="DEBUG" />
        </category>
      • 7.4 and later
        <Logger level="DEBUG" name="com.liferay.portal.events.LoginPreAction" />
    6. Save changes made to the portal-log4j-ext.xml file and start up Liferay.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base