Hi,
Background: We are using log4j to log messages. We have a custom class called Logger to achieve this.
Is is advisable to do this
Logger.log ( "blah blah" , getClass().getName())
everytime I log a message
or
final String className = null
setSessionContext(){
className = getClass().getName()
}
Logger.log('blah blah" ,className)
I would think the latter approach is preferable as the number of calls to getClass()is reduced. But my colleagues had a point that since getClass() is final the first approach is preferable.
Any comments anyone?
Background: We are using log4j to log messages. We have a custom class called Logger to achieve this.
Is is advisable to do this
Logger.log ( "blah blah" , getClass().getName())
everytime I log a message
or
final String className = null
setSessionContext(){
className = getClass().getName()
}
Logger.log('blah blah" ,className)
I would think the latter approach is preferable as the number of calls to getClass()is reduced. But my colleagues had a point that since getClass() is final the first approach is preferable.
Any comments anyone?