[hibernate-dev] on broken usage of logger

Hardy Ferentschik hardy at hibernate.org
Thu Nov 24 05:52:32 EST 2011


On Wed, 23 Nov 2011 17:15:50 +0100, David M. Lloyd  
<david.lloyd at redhat.com> wrote:

> The solution is really easy guys:
>
> log.debugf("The thing I want to log is %s", thing);
> or
> log.debug(thing)
>
> In addition, as you have noticed, it is better to not use the formatting  
> variants if you aren't actually formatting any strings (it doesn't make  
> a difference if the message isn't logged, but if it is there is a slight  
> performance boost).
>
> As for error handling, yes, I think we should be doing somewhat better  
> at that.  Normally this is handled by the internal logging layer but  
> with the variations on they types of backends and the ways they are  
> invoked, we should probably put this protection in at the front end as  
> well.  I would accept a JBLOGGING JIRA to this effect.

Ok, here we go - https://issues.jboss.org/browse/JBLOGGING-75 :-)




More information about the hibernate-dev mailing list