Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.17.2
-
None
Description
Using log4j 1.x to log4j2 bridge with log4j2 2.17.2 and log4j properties, the customer appender that was working in log4j stops working. Upon enabling log4j debug logging, the message shown when processing the appender is:
WARN StatusLogger Unable to load plugin class name org.abc.logging.AppAuditor with key org.abc.logging.appauditor
It is trying to load the custom appender class as a plugin using the fully qualified class name in lower case. It is unable to locate the class. The system property log4j.plugin.packages was added to specify the package name where the custom appender class is located.
Environment information:
The log4j.properties file from log 4j 1.x has these entries for this custome appender:
log4j.logger.AppAuditing = _AUDIT_LOG
log4j.appender._AUDIT_LOG=org.abc.logging.AppAuditor
The custom appender class org.abc.logging.AppAuditor extends from AppenderSkeleton and implements the custom append method.
The client class using the custom appender:
Logger log = Logger.getLogger("AppAuditing");
log.info(message);
No other changes were made to log4j.properties used with log4j 1.x and all steps were completed for log4j 1.x to log4j2 bridge migration. All other logging works as expected with the bridge except the custom appender. This custom appender AppAuditor also works without any issues in log4j 1.x.