This is from the manual: Certain users resort to preprocessing or compile-time techniques to compile out all log statements. This leads to perfect performance efficiency with respect to logging. However, since the resulting application binary does not contain any log statements, logging cannot be turned on for that binary. This is perhaps a disproportionate price to pay in exchange for a small performance gain. The performance gain will be significant only if log statements are placed in tight-loops where the same log request is invoked potentially millions or even billions of times. Inserting logging statements in tight-loops is lose lose proposal. It will slow down your application even if logging is turned off or generate massive logging output if enabled.
HTH, Ceki --- "Sonnathi, Venkat Ramana" <[EMAIL PROTECTED]> wrote: > Try Category.getDefaultHierarchy.disableDebug(). > This should disable all the > DEBUG stmts and the cat.isDebugEnabled does just one > numeric comparision. > > HTH, > --Venkat. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 14,2001 3:09 PM > To: Log4J Users List > Subject: RE: SMTPAppender again > > > > Hi all: > We us log4j for debugging and now the speed of the > execution become big > problem. We found cat.isDebugEnabled()really uses > more then half of > execution time in our project. I was wondering if > there is any easy way to > turn log4J off or make the compiler treat this > method call as comments. > This is a pretty big project, we have about 700 > classes and almost every > method in this project has use this method on entry > and on exit. Comment > out the method call line by line will not be last my > option. Ay suggestions > ? > I am looking forward to hearing from you. > > Thanks > xiaoqi > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com or bid at http://auctions.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
