Define the Category reference for the inner class in the outer class as
well. The inner class has seamlessly access to it.

class Foo {
        private static final Category fooLog =
                 Category.getInstance( Foo.class.getName() );

        private static final Category barLog =
                 Category.getInstance( Bar.class.getName() );

        static class Bar {

                void barMethod() {
                        barLog.debug( "I am bar" );
                }

        }

}

Hope this helps

--

Thomas



| -----Original Message-----
| From: Stephen Levinson [mailto:[EMAIL PROTECTED]]
| Sent: 17 September 2001 21:02
| To: 'LOG4J Users Mailing List'
| Subject: Categories for Inner Classes
|
|
| Hi all...
|
|       In setting categories for classes I am using a STATIC instance of
| Category ... sending in the class name.
|
|       If I have an inner class I'd like to be able to set a category with
| ITS OWN NAME... but I can't use a STATIC in the inner class.
|
|       Is there any way to have the category for an inner class have its
| own name?
|
| Thanks in Advance, Stephen
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
|



*************************************************************************
Copyright ERA Technology Ltd. 2001. (www.era.co.uk). All rights reserved. 
Confidential. No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to