Configuring Logging
In the Server Administration panel’s Log Levels tab, you can set logging levels for classes and packages in Liferay DXP’s class hierarchy and add custom objects to be similarly managed using the Server Administration logging UI. Changes to the log level near the top of the class hierarchy (such as at com.liferay
) also change log levels for all the classes under that hierarchy. Modifications unnecessarily high in the hierarchy generate too many messages to be useful.
If your changes produce more log messages, make them as specific as possible.
Each logging configuration is referred to as a Category.
Adding a Class or Package to the Log Levels User Interface
To add a category,
-
Navigate to Control Panel → Configuration → Server Administration, and click the Log Levels tab.
-
Open the Add Category form by clicking the Add button .
-
Fill out the form and click Save.
-
Click Save.
Logger Name: A class deployed on the server, such as com.liferay.portal.workflow.kaleo.runtime.internal.notification.TemplateNotificationMessageGenerator
Log Level: Choose the logging level you’d like to see: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
For a description of the logging levels, refer to Apache’s Log4j Level
class Javadoc.
Changing the Log Level of an Existing Category
To change the log level of an existing logging configuration,
-
Navigate to Control Panel → Configuration → Server Administration, and click the Log Levels tab.
-
Browse to or search for the category to configure.
-
Use the selector to change the level.
-
Click Save.
Adjusting Levels with XML Files
To adjust the log levels with an XML file,
-
Note the symbolic bundle name of the module (e.g.
com.liferay.saml.opensaml.integration
). -
In your
[LIFERAY_HOME]/osgi/log4j
folder, create an XML file with the following format[symbolicBundleName]-log4j-ext.xml
. For examplecom.liferay.saml.opensaml.integration-log4j-ext.xml
. -
Define the logger level in the XML file. For example,
<?xml version="1.0"?>
<Configuration strict="true">
<Loggers>
<Logger level="DEBUG" name="com.liferay.saml.opensaml.integration" />
</Loggers>
</Configuration>
Note, the configuration is in the XML Schema Definition (XSD) format and not in Document Type Definition (DTD) format.