You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Martin Kleppmann (JIRA)" <ji...@apache.org> on 2014/06/05 23:18:01 UTC

[jira] [Updated] (SAMZA-275) Exception stack traces not logged

     [ https://issues.apache.org/jira/browse/SAMZA-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Kleppmann updated SAMZA-275:
-----------------------------------

    Attachment: SAMZA-275.patch

Attaching patch of a quick find-and-replace. RB: https://reviews.apache.org/r/22279/

> Exception stack traces not logged
> ---------------------------------
>
>                 Key: SAMZA-275
>                 URL: https://issues.apache.org/jira/browse/SAMZA-275
>             Project: Samza
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>            Reporter: Martin Kleppmann
>            Assignee: Martin Kleppmann
>             Fix For: 0.7.0
>
>         Attachments: SAMZA-275.patch
>
>
> In various places we are using the following logging idiom for exceptions:
> {noformat}
> try { ... } catch {
>   case e: Exception =>
>     info("Something went wrong: %s. Turn on debug for details." format e)
>     debug(e)
> }
> {noformat}
> Unfortunately that doesn't have the desired effect, because slf4j calls .toString() on the first argument to the log method, so the debug log ends up containing only the exception name and message, but not the stack trace.
> For the stack trace to be logged, the exception must be the second argument, like this:
> {noformat}
> debug("Exception detail:", e)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)