[ 
https://issues.apache.org/jira/browse/LOG4J2-684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589465#comment-14589465
 ] 

Mauro Molinari commented on LOG4J2-684:
---------------------------------------

Hi Gary,
I was using version 2.2. Now tried with 2.3 and the result is the same: the 
suppressed exceptions are not printed in the log.
I'm using Sl4j 1.7.7 to drive Log4j, but I don't think it's performing any 
manipulation on the passed exception (like removing the suppressed exceptions).

My Log4j configuration is this:

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration strict="true">
        <Appenders>
                <Console name="console" target="SYSTEM_OUT">
                        <Layout type="PatternLayout" pattern="[%-5p] 
%d{yyyy/MM/dd HH:mm:ss} - %t - %c - %m%n" />
                </Console>
                <RollingRandomAccessFile name="file" append="true" 
fileName="${web:rootDir}/WEB-INF/log/application.log"
                        
filePattern="${web:rootDir}/WEB-INF/log/application-%d{yyyy-MM-dd}.log.gz">
                        <Layout type="PatternLayout" pattern="[%-5p] 
%d{yyyy/MM/dd HH:mm:ss} - %t - %c - %m%n" />
                        <Policies>
                                <TimeBasedTriggeringPolicy />
                        </Policies>
                        <DefaultRolloverStrategy compressionLevel="9" />
                </RollingRandomAccessFile>
        </Appenders>
        <Loggers>
                <!-- If showSql is enabled, this is needed to actually view SQL 
generated by EclipseLink -->
                <Logger name="org.eclipse.persistence.logging.sql" 
level="debug" />

                <Root level="info">
                        <AppenderRef ref="console" />
                </Root>
        </Loggers>
</Configuration>
{code}

> ConsoleAppender does not print suppressed exceptions
> ----------------------------------------------------
>
>                 Key: LOG4J2-684
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-684
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-rc1
>         Environment: 
> ------------------------------------------------------------
> Gradle 1.12
> ------------------------------------------------------------
> Build time:   2014-04-29 09:24:31 UTC
> Build number: none
> Revision:     a831fa866d46cbee94e61a09af15f9dd95987421
> Groovy:       1.8.6
> Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
> Ivy:          2.2.0
> JVM:          1.8.0_05 (Oracle Corporation 25.5-b02)
> OS:           Mac OS X 10.9.3 x86_64
>            Reporter: Joern Huxhorn
>
> (Actual version was 2.0-rc2 but that wasn't available in the list.)
> Currently, any potentially available suppressed exceptions are ignored by 
> ConsoleAppender.
> Instead, it should print those exceptions with the prefix "Suppressed: ". Be 
> aware that suppressed exceptions are indented with a \t, recursively, in 
> contrast to the way "Caused by: " is handled.
> See Throwable.printStackTrace of Java 7 or higher for the implementation.
> Feel free to use the code over at 
> https://github.com/huxi/lilith/blob/master/lilith-data/logging/src/main/java/de/huxhorn/lilith/data/logging/ThrowableInfo.java
>  if it helps.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to