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.

On 6/5/2015 8:25 AM, Lukas Krejci wrote:
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 
https://github.com/jboss-logging/jboss-logging-tools/pull/31 which I fear is going to get
rejected but I still think it is at least partially a good idea ;)

Lukas


----- Original Message -----
From: "Peter Palaga" <ppalaga@redhat.com>
To: "Discussions around Hawkular development" <hawkular-dev@lists.jboss.org>
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] https://issues.jboss.org/browse/HAWKULAR-309
_______________________________________________
hawkular-dev mailing list
hawkular-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev

_______________________________________________
hawkular-dev mailing list
hawkular-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev