logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48902] New: log4j-extras - Enhancement : add %throwable{compact} to EnhancedPatternLayout
Date Fri, 12 Mar 2010 17:48:21 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48902

           Summary: log4j-extras - Enhancement : add %throwable{compact}
                    to EnhancedPatternLayout
           Product: Log4j
           Version: unspecified
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: cleclerc@pobox.com


Here is a proposal to add an intermediate way to emit throwables in the logs.
It is between '%throwable{short}' that only add the class name and message of
the given throwable and standard '%throwable' that emits the full stacktrace.

This proposed '%throwable{compact}' concatenates the class name and message of
the given throwable and its causes on the same line as the .

SAMPLES
======

NONE
-----

log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss,SSS} %5p
[%t] %c - %m %throwable{none} %n

2010/03/12 18:39:00,083 ERROR [main] my-category - An exception occured  

SHORT
-----

log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss,SSS} %5p
[%t] %c - %m %throwable{short} %n

2010/03/12 18:37:34,580 ERROR [main] my-category - An exception occured
java.io.IOException: Exception invoking http://example.com/


COMPACT
--------

log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss,SSS} %5p
[%t] %c - %m %throwable{compact} %n

2010/03/12 18:35:34,934 ERROR [main] my-category - An exception occured  -
java.io.IOException: Exception invoking http://example.com/
java.net.SocketTimeoutException: Read timed out 

STANDARD
---------

log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss,SSS} %5p
[%t] %c - %m %throwable %n

2010/03/12 18:40:01,930 ERROR [main] my-category - An exception occured
java.io.IOException: Exception invoking http://example.com/
    at ExceptionTest.main(ExceptionTest.java:11)
Caused by: java.net.SocketTimeoutException: Read timed out
    ... 1 more

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message