The log4j2.properties file lets you configure logging levels to provide debugging information when troubleshooting. You can set the log level dynamically using the JMX client.
When using log4j, you should:
-
Keep local customizations and licenses outside of the web application. For example, in the extension directory:
$TOMCAT_HOME/shared/classes/alfresco/extension/...-log4j2.properties
-
The supplied configuration files should be stored or installed within the web application. For example:
WEB-INF/classes/alfresco/extension/...-log4j2.properties
Logging uses the Log4J LoggerContextAdminMBean.
-
The Loggers component of the LoggerContextAdminMBean is a dynamic list of loggers with the level attribute, which can be changed to OFF, FATAL, ERROR, WARN, INFO, DEBUG or TRACE (editable).
-
addLoggerMBean will be impacted if it has been loaded.
The following steps provide instructions on adding loggers using JConsole:
-
Click Alfresco > Log4jManagement > Operations > addLoggerMBean.
-
Type the full className in Name on the right hand pane.
-
Click addLoggerMBean.
A dialog box is displayed specifying that the method is successfully invoked.