You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by manish_goyal <ma...@infosys.com> on 2008/11/23 14:26:59 UTC
Can we define multiple Logger instance in a single class file?
Hi,
Could any one tell me how to create multiple Logger instance in a single
class?
Is this possible?
If it is possible then what will be the value for "?". Logger myLogger =
Logger.getLogger("?"); in java file.
and for referring the same Logger instance in log4j.properties file, how we
will be defining the Appender.
I don't want to use rootLogger .
Please respond me as soon as possible.
Thanks.
Regards,
Manish
--
View this message in context: http://www.nabble.com/Can-we-define-multiple-Logger-instance-in-a-single-class-file--tp20646150p20646150.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Can we define multiple Logger instance in a single class file?
Posted by Chris Custine <cc...@apache.org>.
You can create any number of loggers that you want. Logger.getLogger()
takes either a Class or String as argument. You refer to this logger in the
log4j properties by the same string.
--
Chris Custine
My Blog :: http://blog.organicelement.com
Apache ServiceMix :: http://servicemix.apache.org
Apache Directory Server :: http://directory.apache.org
On Sun, Nov 23, 2008 at 6:26 AM, manish_goyal <manishkumar_goyal@infosys.com
> wrote:
>
> Hi,
>
> Could any one tell me how to create multiple Logger instance in a single
> class?
>
> Is this possible?
>
> If it is possible then what will be the value for "?". Logger myLogger =
> Logger.getLogger("?"); in java file.
> and for referring the same Logger instance in log4j.properties file, how we
> will be defining the Appender.
>
> I don't want to use rootLogger .
>
> Please respond me as soon as possible.
>
> Thanks.
>
> Regards,
> Manish
> --
> View this message in context:
> http://www.nabble.com/Can-we-define-multiple-Logger-instance-in-a-single-class-file--tp20646150p20646150.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>