Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.17.2
-
None
-
None
Description
While trying to migrate to Log4j 2.x from Log4j 1.x using Bridge API approach, the following behavious was observed.
logger = Logger.getLogger(loggerName);
logger.log(Level.ERROR, msg, t);
The above code snippet was generating the logger message along with the exception stack trace in Log4j 1.x.
PropertiesFactory ERROR (FactoryDbBase.java:getOptionalAttributeValue:113) [main] | Invalid Attribute DB Exception Occured.
InvalidAttributeDbException: Parameter [abc] in DB is invalid.
at abc.xyz.Registry.init(Registry.java:80) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1748) ~[spring-beans-4.3.30.jar:4.3.30.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1685) ~[spring-beans-4.3.30.jar:4.3.30.RELEASE
whereas the Log4j 1.2 Bridge API is printing only the message without the throwable object information/stack trace.
PropertiesFactory ERROR (FactoryDbBase.java:getOptionalAttributeValue:113) [main] | Invalid Attribute DB Exception Occured.