users@glassfish.java.net

RE: Re: Log4j is not logging

From: Jason Lee <lee_at_iecokc.com>
Date: Wed, 30 Aug 2006 09:48:54 -0500

Hmm... That didn't seem to fix anything. I'm still not getting any
logs. Here's my log4j.properties:

log4j.rootLogger=DEBUG, file

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{DATE} %5p %c{1}:%L -
%m%n

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{DATE} %5p %c{1}:%L -
%m%n
log4j.appender.file.File=/java/logs/Oprah/OrderTransfer.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=5

log4j.logger.com.iecokc=DEBUG

I tried the same config in a stand-alone, command line app, and it works
as expected. Am I possible packaging this incorrectly in my .ear? I
vaguely remember a blog entry suggesting the log4j config needs to go in
a jar in $EAR/lib. Is that correct?

-----
Jason Lee
Programmer/Analyst
http://www.iecokc.com
 

> -----Original Message-----
> From: Jan.Luehe_at_Sun.COM [mailto:Jan.Luehe_at_Sun.COM]
> Sent: Tuesday, August 29, 2006 9:17 PM
> To: users_at_glassfish.dev.java.net
> Subject: Re: Log4j is not logging
>
> Hi Jason,
>
> Jason Lee wrote On 08/29/06 12:57,:
>
> > I touched on this briefly several weeks ago, but was not able to
> > follow up at the time. At any rate, we're using log4j (with and
> > without the commons logging facade -- doesn't seem to matter), but
> > none of our log messages are going to where we have it
> configured in
> > log4j.xml. They all end up in the domain server log. The log4j
> > config looks like this:
> >
> > <appender name="file" class="org.apache.log4j.RollingFileAppender">
> > <param name="File" value="d:/java/logs/Oprah/OrderTransfer.log" />
> > <param name="MaxFileSize" value="10MB" />
> > <param name="MaxBackupIndex" value="5" />
> > <layout class="org.apache.log4j.PatternLayout">
> > <param name="ConversionPattern" value="%d{DATE} %5p
> %c{1}:%L - %m%n" />
> > </layout>
> > </appender>
> > I've tried various permutations of that including leaving off the
> > drive letter, with no noticeable effect. The config file is in the
> > root of $APP.jar which is in the root of $APP.ear. We're also
> > bundling the log4j and commons logging jars with the apps
> > ($APP.ear/lib/) in case that matters.
> >
> > Any ideas why we can't get a handle on the logging? I'm trying to
> > track down an unrelated problem with an app, and the
> logging issue is
> > really causing me some heartburn. :) Thanks...
>
>
> Can you send me your complete log4j.xml, including its
> DOCTYPE declaration?
> Do you see any errors in the server.log?
>
> When I tried using a log4j.xml config file, I saw this error
> in server.log:
>
> log4j:ERROR DOM element is - not a <log4j:configuration> element.
>
> I'll need to investigate.
>
> Using a log4j.properties works for me, though.
>
> Can you switch from using log4j.xml to using log4j.properties
> for the time being?
>
> Thanks,
>
>
> Jan
>
>
> >
> > -----
> > Jason Lee
> > Programmer/Analyst
> > http://www.iecokc.com <http://www.iecokc.com/>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>