Quoting James Stauffer <[EMAIL PROTECTED]>:

> Don't put log4j.jar or your log4j config file in a shared location but
> put them under each web app.  Then your logs should stay separate.
>

Or use a RepositorySelector implementation, but that's way more complicated than
 what James suggests.

Actually, you can have log4j.jar and a config file in a shared location (such as
common/lib to have Tomcat log using Log4j) as long as you **also** include
log4j.jar in WEB-INF/lib and the config file in WEB-INF/classes of each webapp.
 Note that the config file should be a log4j.xml file.  If it isn't, Log4j in
your webapp will look to a parent classloader to look for one.  If it finds it,
it almost certainly won't be the one you want.  If you perform manual
configuration, at least put a dummy minimal log4j.xml file in WEB-INF/classes
so that autoconfiguration doesn't pick up some arbitrary config file.

Jake

> On 1/31/07, Tracy12 <[EMAIL PROTECTED]> wrote:
> >
> > If I have seperate web applications running in TOMCAT, each got its own
> log4j
> > configuration.
> >
> > Seems like the logging is not consistent, i.e for e.g Application A's log
> > messages appearing in Application B's log file.
> >
> > What is the best way to overcome a situation like this.
> >
> > Any articles to refer ?
> >
> > Thanks
> > --
> > View this message in context:
> http://www.nabble.com/What-is-the-best-way-tf3152357.html#a8741064
> > Sent from the Log4j - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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]
>




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

Reply via email to