Thank you very much Javier for your kind help and support.

I tried as explained below. It could able to resolve component specific logging 
issue.


Thanks and Regards,

HITESH RAGHAV
Bangalore - 560 047, India.
Tel: +91-80-2841 0680  Extn:289 (W)
Cell: +91-924 310 2033
Fax: +91-80-2841 0690 (W)
eMail: [EMAIL PROTECTED]
       [EMAIL PROTECTED] (W)




> ----- Original Message -----
> From: "Javier Gonzalez" <[EMAIL PROTECTED]>
> To: "Log4J Users List" <[email protected]>
> Subject: Re: Component specific logging
> Date: Thu, 23 Feb 2006 09:47:52 -0300
> 
> 
> I think that you need to identify the naming scheme for the loggers of each
> 3rd party component (by doing a test run at debug level with a layout
> configuration that prints the whole logger name), and then configure log4j
> to send each of those logger hierachies to distinct files.
> 
> For example, suppose you have four 3rd party components, and their logger
> naming schemas are like this:
> 
> component 1: com.somecompany.component1.*
> component 2: com.anothercompany.component2.*
> component 3: com.yetanothercompany.component3.*
> component 4: org.someorg.component4.*
> 
> I'd proceed like this:
> 
> 1.- configure root logger as desired
> 
> 2.- turn off additivity on each component, like this:
> 
> log4j.additivity.com.somecompany.component1=false
> 
> 3.- Configure each component logging hierachy with desired level and
> attaching the proper appender (as defined in the next point):
> 
> log4j.logger.com.somecompany.component1=INFO,Component1Appender
> 
> 4.- Configure a file appender to each component logging hierachy, for
> example:
> 
> log4j.appender.Component1Appender=org.apache.log4j.RollingFileAppender
> log4j.appender.Component1Appender.Append=true
> log4j.appender.Component1Appender.MaxBackupIndex=3
> log4j.appender.Component1Appender.File=component1.log
> log4j.appender.Component1Appender.layout=org.apache.log4j.PatternLayout
> log4j.appender.Component1Appender.layout.ConversionPattern=%d{ISO8601}%c{1}>
> %m%n
> 
> Turning off additivity will ensure that you don't get a component logs mixup
> at the root logger level.
> 
> Cheers,
> 
> Javier.
> 
> On 2/23/06, Hitesh Raghav <[EMAIL PROTECTED]> wrote:
> >
> > Hi All,
> >
> > In my application 3-4 third party components are being used. For logging
> > configuration, all the components are refering to "log4j.properties". It's
> > placed in "properties" folder of application server.
> > Therefore, all the coponents are logging into the same log file.
> >
> > I've to generate the component specific log file.
> >
> > Could you please guide me regarding the same.
> >
> > Note: I've no access on any third party component's code.
> >
> >
> > Thanks and Regards,
> >
> > HITESH RAGHAV
> > Bangalore - 560 047, India.
> > Tel: +91-80-2841 0680  Extn:289 (W)
> > Cell: +91-924 310 2033
> > Fax: +91-80-2841 0690 (W)
> > eMail: [EMAIL PROTECTED]
> >        [EMAIL PROTECTED] (W)
> >
> >
> >
> > --
> > _______________________________________________
> >
> > Search for businesses by name, location, or phone number.  -Lycos Yellow
> > Pages
> >
> >
> > http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> Javier González Nicolini

>



-- 
_______________________________________________

Search for businesses by name, location, or phone number.  -Lycos Yellow Pages

http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10


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

Reply via email to