Hi Ceki,<div><br></div><div>Thanks for looking into this. I've created an issue in JIRA:
<a href="http://jira.qos.ch/browse/LOGBACK-722">http://jira.qos.ch/browse/LOGBACK-722</a> </div><div><br></div><div>-Abraham</div><div><br><br><div class="gmail_quote">On Mon, Jul 16, 2012 at 5:44 PM, ceki <span dir="ltr"><<a href="mailto:ceki@qos.ch" target="_blank">ceki@qos.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I think this is a bug in ThrowableProxy. Could you please create a jira issue for this? Thank you.<div class="im"><br>
<br>
On 16.07.2012 23:24, Abraham Lin wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Ceki,<br>
<br>
Thanks for the response. Here's a trivial example:<br>
<br>
public class Main {<br>
public static void main( String[] args ) {<br>
org.slf4j.Logger logger = org.slf4j.LoggerFactory<br>
.getLogger( Main.class );<br>
Exception e1 = new CustomException( );<br>
e1.printStackTrace( System.out );<br>
</div><a href="http://logger.info" target="_blank">logger.info</a> <<a href="http://logger.info" target="_blank">http://logger.info</a>>( "", e1 );<div class="im"><br>
System.out.println( );<br>
Exception e2 = new CustomException( "Test message" );<br>
e2.printStackTrace( System.out );<br>
</div><a href="http://logger.info" target="_blank">logger.info</a> <<a href="http://logger.info" target="_blank">http://logger.info</a>>( "", e2 );<div class="im"><br>
}<br>
static class CustomException extends Exception {<br>
CustomException( ) {}<br>
CustomException( String message ) { super( message ); }<br>
@Override<br>
public String toString( ) {<br>
return super.toString( ) + " (from toString)";<br>
}<br>
}<br>
}<br>
<br>
Running the above yields this output:<br>
<br>
com.example.logback.Main$<u></u>CustomException (from toString)<br>
at com.example.logback.Main.main(<u></u>Main.java:7)<br>
17:19:50.445 [main] INFO com.example.logback.Main -<br>
com.example.logback.Main$<u></u>CustomException: null<br>
at com.example.logback.Main.main(<u></u>Main.java:7) ~[classes/:na]<br>
com.example.logback.Main$<u></u>CustomException: Test message (from toString)<br>
at com.example.logback.Main.main(<u></u>Main.java:13)<br>
17:19:50.451 [main] INFO com.example.logback.Main -<br>
com.example.logback.Main$<u></u>CustomException: Test message<br>
at com.example.logback.Main.main(<u></u>Main.java:13) ~[classes/:na]<br>
<br>
What do you think?<br>
<br>
-Abraham<br>
<br>
<br></div>
On Mon, Jul 16, 2012 at 5:02 PM, ceki <<a href="mailto:ceki@qos.ch" target="_blank">ceki@qos.ch</a> <mailto:<a href="mailto:ceki@qos.ch" target="_blank">ceki@qos.ch</a>>><div><div class="h5"><br>
wrote:<br>
<br>
Hi Abraham,<br>
<br>
Can you provide an example of the difference?<br>
--<br>
Ceki<br>
<a href="http://tinyurl.com/proLogback" target="_blank">http://tinyurl.com/proLogback</a><br>
<br>
<br>
On 16.07.2012 22:32, Abraham Lin wrote:<br>
<br>
Hi,<br>
<br>
In comparing the outputs of Throwable#printStackTrace and logback, I<br>
found an inconsistency in how the Throwable instances are<br>
printed. While<br>
the former delegates to the Throwable instance's #toString<br>
method, the<br>
latter (partially) re-implements the default implementation in<br>
Throwable, which means that data contained in the #toString<br>
methods of<br>
Throwable subclasses is discarded. While this is easy to work<br>
around in<br>
my own code, there is still a problem when working with third-party<br>
libraries.<br>
<br>
Is there a configuration option that would allow me to specify<br>
my own<br>
IThrowableProxy implementation? (I couldn't find any pages<br>
describing<br>
the extension points and how to activate them.) Or would it be more<br>
appropriate to modify the ThrowableProxyUtil class so that it<br>
behaves<br>
similarly to #printStackTrace? Any ideas would be greatly<br>
appreciated.<br>
<br>
Thanks in advance!<br>
<br>
-Abraham<br>
<br>
<br>
<br>
</div></div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
-- <br>
Ceki<br>
<a href="http://tinyurl.com/proLogback" target="_blank">http://tinyurl.com/proLogback</a></font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/<u></u>listinfo/logback-user</a><br>
</div></div></blockquote></div><br></div>