users@glassfish.java.net

Re: Log4j is not logging

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 29 Aug 2006 19:16:59 -0700

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/>
>