<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <font face="Calibri">Customers are not interested and it erodes
      confidence.  Unless you want a support case to result from that
      stack trace you probably don't want a stack trace.  In your
      example I don't think I'd want to see a stack trace as a
      connection issue is often caused by mundane reasons (server not
      up).  Of course, there are times when a trace would be super
      valuable.  I'm also not against additional information (like a
      trace) being provided when debug is enabled</font>.<br>
    <br>
    <div class="moz-cite-prefix">On 6/5/2015 8:25 AM, Lukas Krejci
      wrote:<br>
    </div>
    <blockquote
      cite="mid:364873995.11414121.1433507100091.JavaMail.zimbra@redhat.com"
      type="cite">
      <pre wrap="">I think the reason for NOT exposing causes is that end users are usually not interested in
them.

On the other hand they can provide additional diagnostic information so devs are interested
;)

The default formatters in wfly have the %E parameter which will include the stacktrace in 
the log message if you provide one but at least for me, having the log filled with 
stacktraces just defeats the purpose of a log, because it becomes nearly unintelligible.

Of course, you can reconfigure your loggers and handlers to use different formatters at
different occasions so "log mess" is not an argument against using @Cause's in your
log messages but IMHO the defaults in Wfly are at least problematic because they expose
the mess.

Btw. your email got me completely on a tangent yesterday and I ended up with 
<a class="moz-txt-link-freetext" href="https://github.com/jboss-logging/jboss-logging-tools/pull/31">https://github.com/jboss-logging/jboss-logging-tools/pull/31</a> which I fear is going to get
rejected but I still think it is at least partially a good idea ;)

Lukas


----- Original Message -----
</pre>
      <blockquote type="cite">
        <pre wrap="">From: "Peter Palaga" <a class="moz-txt-link-rfc2396E" href="mailto:ppalaga@redhat.com">&lt;ppalaga@redhat.com&gt;</a>
To: "Discussions around Hawkular development" <a class="moz-txt-link-rfc2396E" href="mailto:hawkular-dev@lists.jboss.org">&lt;hawkular-dev@lists.jboss.org&gt;</a>
Sent: Thursday, 4 June, 2015 11:49:34 AM
Subject: [Hawkular-dev] Reasons not to use        org.jboss.logging.annotations.Cause at all?

Hi *,

I am just improving the log output in Pinger and Availability Creator
[1] and I found out that one can define a LogMessage containing all the
details of a thrown exception (incl error message and stack trace) like
this:

     @LogMessage(level = Logger.Level.ERROR)
     @Message(id = 5007, value = "Could not send a message to the bus")
     void eCouldNotSendMessage(@Cause Throwable e);

Indeed, messages like this can be seen in Bus, Agent and Inventory, but
nowhere else.

Are there some reasons for *not* using this @Cause message style at all?

It is clear that not every thrown exception needs to clutter the log
with its stack trace. But generally, things that are supposed to work in
all cases and situations (like sending messages to bus) should be logged
incl. stack traces, should they not?

Thanks,

Peter

[1] <a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/HAWKULAR-309">https://issues.jboss.org/browse/HAWKULAR-309</a>
_______________________________________________
hawkular-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/hawkular-dev">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a>

</pre>
      </blockquote>
      <pre wrap="">_______________________________________________
hawkular-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/hawkular-dev">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a>


</pre>
    </blockquote>
    <br>
  </body>
</html>