aspose file tools*
The moose likes Performance and the fly likes Logger: use isDebugEnabled/isTraceEnabled or just log? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Logger: use isDebugEnabled/isTraceEnabled or just log?" Watch "Logger: use isDebugEnabled/isTraceEnabled or just log?" New topic
Author

Logger: use isDebugEnabled/isTraceEnabled or just log?

olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
Hi

I have some code which uses logback for logging. I read somewhere that its better to use



instead of only:


I am wondering if this is true, because it blows the code to a much bigger size, which makes it more unreadable.

I can assume that its better to use LOG.isTraceEnabled() when using stuff like String.format(), but is this true also for regular LOG.trace() calls?
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 396

As far as I'm aware ;-) your correct and only useful for string formatting etc which isn't involved in this case.


"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logger: use isDebugEnabled/isTraceEnabled or just log?
 
Similar Threads
Issue in using the DatabaseServerLoginModule for encrypting the password using MD5
Is this overkill (logging) ?
Redirecting messages to a file ... append
struts-config.xml:default for action tag input attribute
WSWS3192E: Error: return code: ( 400 ) Bad Request when trying to invoked webservice