[Hawkular-dev] Reasons not to use org.jboss.logging.annotations.Cause at all?

Peter Palaga ppalaga at redhat.com
Thu Jun 4 05:49:34 EDT 2015


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


More information about the hawkular-dev mailing list