Thanks for the reply. I have tried this, but unfortunately it did not work. May
be I am doing something wrong. A sample of my approach is given below.
Regards,
Orko
<logger name="test.first.Another.main">
<level value="TRACE"/>
<appender-ref ref="CONSOLE"/>
</logger>
<root>
<priority value="ERROR" />
<appender-ref ref="CONSOLE"/>
</root>
It supposed to show all logs from main, and error logs otherwise. (If my
understanding is right). but I am getting following output for %5p [%c] [%C.%M]
(%F:%L) - %m%n format:
ERROR [test.first.Another] [test.first.Another.main] (Another.java:19) - error
message
ERROR [test.first.Another] [test.first.Another.testAMethod] (Another.java:34) -
another error Msg
Matthew Kemp <[EMAIL PROTECTED]> wrote: One solution (although I'm not sure
about the performance impacts) would be
to create loggers that are children of the class logger. For example if you
had a class 'Bar' in package 'foo', the your logger for the class would be '
foo.Bar'. If Bar has a method bar() and baz() you could create a loggers '
foo.Bar.bar' and 'foo.Bar.baz' that could each have their own level.
On 10/11/07, orko wrote:
>
> Hi all,
> I am trying to implement log4j for my application. I can set the logger to
> class level. But, is it possible to set logger for a particular method under
> a class (I/user may not need to view all the logs from different methods)?
> Thanks in advance,
>
> -Orko
>