Make it an instance variable:
private Logger logger = Logger.getLogger(getClass().getName());
On 1/8/07, Sunil Bapat <[EMAIL PROTECTED]> wrote:
I read the log4j article regarding using RepositorySelector to create
distinct logger hierarchies for multiple web applications on the same
servlet container.
However in all the log4j examples, to prevent calling getLogger for
every logger call, the logger usage pattern is public class MyClass {
final static Logger logger = Logger.getLogger("some.name");
If MyClass is used by multiple web applications, the static variable
logger will not be valid for all usages. I will be a logger in just
one of the hierarchies.
What should the getLogger pattern be when using multiple hierachies.
Is there any alternative to calling getLogger for every call?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
James Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]