Adding new loggers at runtime via JMX - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

If you were relying on the Alfresco:Name=Log4jHierarchy JMX bean to add new loggers at runtime, you can now use the Alfresco:Name=Log4jManagement bean to perform the same operation.

The Alfresco:Name=Log4jManagement bean exposes an addLoggerMBean operation which requires the package or class name of the desired logger as input. Once the logger is successfully added, a new JMX bean will be registered under org.apache.logging.log4j2:type=<LogContextName>,component=Loggers. This additional bean will be of type LoggerConfigAdminMBean - it should match the name of the desired package/class name, and it can be reconfigured at runtime as described in the section above.

Note: If you have multiple org.apache.logging.log4j2:type=<LogContextName>,component=Loggers components with different <LogContextName> values, you can identify the correct one to refer to by checking the value of the Alfresco:Name=Log4jManagement read-only attribute named LogContextName. The value of LogContextName should match.