[logback-dev] [JIRA] Created: (LBCLASSIC-250) ThrowableProxyUtil.printFirstLine - allow customisation of output (use Throwable.toString instead of getMessage)

Alvin Chee (JIRA) noreply-jira at qos.ch
Thu Feb 10 06:32:52 CET 2011


ThrowableProxyUtil.printFirstLine - allow customisation of output (use Throwable.toString instead of getMessage)
----------------------------------------------------------------------------------------------------------------

                 Key: LBCLASSIC-250
                 URL: http://jira.qos.ch/browse/LBCLASSIC-250
             Project: logback-classic
          Issue Type: New Feature
          Components: Other
    Affects Versions: 0.9.28
            Reporter: Alvin Chee
            Assignee: Logback dev list


I have a custom exception class (BaseException) with an "errorCode" attribute, and overridden the toString method to return errorCode + Exception.getMessage

log4j is simply using toString(), which logs the exceptions as required.

ThrowableProxyUtil.printFirstLine uses
buf.append(tp.getClassName()).append(": ").append(tp.getMessage());

In some cases, Exception.getMessage will return null, as my application will only return the error code to the caller.

Can logback provide an option to use toString instead of manually appending the class name and getMessage? or simply use toString?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list