Author
Obtaining access to Logger using a different Mechanism
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
Hi, we are using a Log4j to implement Logging Mecanism in our Application .
we are not using
to obtain access to Log4j
Instead we used an SomeLogger class taht will return the instance of the Logger as shown below .
A code snippet of this SomeLogger is shown below :
What is the advantage we get if we use this way ??
Thanks in advance .
Save India From Corruption - Anna Hazare.
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
I don't see a reason why that SomeLogger class is required. Does it have any javadoc or anything else which explains why it's there?
[My Blog ] [JavaRanch Journal ]
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
Thanks Jai for the response .
This might be useful to provide me a better response , this is the only code
// This code is getting the log4j.properties path
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
Isn't that class pointless? Why have you chosen to not use the out the box mechanisms for loading your log4j configuration?
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Apr 06, 2010 04:49:42
0
Yeah, unless there's other magic going on, or you really, really need to have your logging properties specified as a string constant, there are better, easier, more conventional ways of doing this.
I agree. Here's the link: jrebel
subject: Obtaining access to Logger using a different Mechanism