When logging exceptions (Throwables) some data is lost, perhaps because logback does not use toString() and printStatckTrace() but rather extracts certain fields and prints them manually. Consider WBEMException which adds the remote host error code, and overrides toString() to display that error code. This means that printStatckTrace() also shows the error code. But logback does not show the additional information in extended Throwables. It appears that logback is manually extracting only fields known to Throwable and thus loses any additional information added by custom Exceptions. I would suggest that logback use toString() and printStackTrace() whenever possible.
This may be related to LOGBACK-998 (or even a duplicate, cannot tell if that issue is because printStackTrace() is overridden by submitter's exceptions).
|