I'll definitely second the motion to go with slf4j wherever possible!
And commons logging is just plain evil, it does things with classloaders
that don't bear thinking about...

On Sat, Jun 27, 2009 at 11:05 PM, Alan M <alan.morten...@gmail.com> wrote:

>
> I tried the log4j.xml in classes but it didn't work, until... :) I
> renamed it to default.log4j.xml and fixed a conflict with log4j and
> commons-logging libraries.  It turns out in Tomcat that you have to be
> very careful about how you load those libraries, especially when using
> something like maven.  Basically as per an interesting article on the
> log4j web site (that I don't have the URL for on this computer) you
> should put a copy of the log4j and commons-logging jars in the common/
> lib directory of tomcat and not in any particular web-app or else it
> gets confused.  It was also a bit of an endorsement for SFL4j though I
> didn't really look into to that so close yet.
> Anyway, once I did that (manually for now, have to fix the pom to not
> include those two from dependencies.. ugh..) everything worked as
> expected.  Woohoo!!
>
> Alan
>
> On Jun 27, 3:17 am, "marius d." <marius.dan...@gmail.com> wrote:
> > I think that simply putting log4j.xml in WEB-INF/classes folder does
> > the trick.
> >
> > Br's,
> > Marius
> >
> > On Jun 27, 3:06 am, Alan M <alan.morten...@gmail.com> wrote:
> >
> > > I'm trying to enable log4j logging in a third party library (well
> > > third party to me.. it was developed in house) so that it logs it's
> > > output to the same place my Lift webapp logs.
> >
> > > In the third party library, a log4j Logger is obtained and used but no
> > > setup is done, figuring the log4j config will be done by the app
> > > builder.
> >
> > > Now I figured the root logger would catch it.. but it didn't seem to
> > > work.  So I added a specific logger with the exact string used in the
> > > third party code..  Still no output..
> >
> > > Am I missing something about class loaders?  Or is there something
> > > about start-up that's messing with the getLogger method (it's actually
> > > in the method so it should be happening after Lift initializes
> > > everything)?  Or is there something else special about lift logging
> > > that won't let the library piggy back off of it?
> >
> > > BTW, I should mention that Lift logging otherwise is working for me.
> > > By otherwise I mean when logging from any classes directly in the web-
> > > app classes directory.
> >
> > > Alan
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to