You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Vidya (Jira)" <ji...@apache.org> on 2022/09/21 17:23:00 UTC

[jira] [Created] (LOG4J2-3604) Log4j 1.2 Bridge not printing exception stack traces

Vidya created LOG4J2-3604:
-----------------------------

             Summary: Log4j 1.2 Bridge not printing exception stack traces
                 Key: LOG4J2-3604
                 URL: https://issues.apache.org/jira/browse/LOG4J2-3604
             Project: Log4j 2
          Issue Type: Bug
          Components: Log4j 1.2 bridge
    Affects Versions: 2.17.2
            Reporter: Vidya


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.

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)