Hi Sriram,


Do you have log4j.jar in WEB-INF/lib? If not, I'd expect default initialization not to work. Remember that the webapp class loader can see parent class loaders, but the parents cannot see the webapp class loader, hence your log4j.properties will definitely not be found. If you are trying to use log4j.jar in a parent class loader and want your own configuration file to be used in your own logging space, then you will need to use a repository selector. See the log4j-sandbox for working examples. I wrote something up about this stuff here...
http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging


Jake

At 09:35 AM 8/28/2003 +0530, you wrote:
The properties file is not being read at all!!!!

I placed it in WEB-INF/classes.

Still it's not being read.

I am JBoss and JBoss contains log4j.jar by default and it has log4j.xml in default/conf folder.
Probably even my application is taking log4j.xml from that location by default. I need to check that. Anyone who has implemented log4j for their applications on JBoss, pl. suggest.



Sriram


-----Original Message-----
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 6:52 PM
To: Log4J Users List
Subject: Re: Log file location



Is the properties file being read at all?

At 06:25 PM 8/27/2003 +0530, sriram wrote:
>Hi,
>
>I am unable to set log file location. I searched the forum for old
>messages and found some. I tried the way it was mentioned in those
>messages, but still my problem is not solved.
>
>My log4j.properties file is as follows:
>
>log4j.rootCategory=WARN, dest1, R
>log4j.appender.dest1=org.apache.log4j.ConsoleAppender
>log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
>log4j.appender.dest1.layout.ConversionPattern=%-5p: %m%n
>
>#### appender writes to a file
>log4j.appender.R=org.apache.log4j.RollingFileAppender
>log4j.appender.R.layout=org.apache.log4j.PatternLayout
>log4j.appender.R.layout.ConversionPattern=%-5p: %m%n
>log4j.appender.R.File=d:/jboss/errors.log
>
>
>I packaged  by application as .ear and deployed it on JBoss running on
>Win
>2000.
>
>When I run the application, I can see the log messages on JBoss
>console,
>but these messages are not getting stored in the file I've specified
>(d:/jboss/errors.log).
>
>What could be the problem? In fact, initially I tried
>${jboss.home}/errors.log, but it didn't work. So I thought of hard coding
>the file location and tried it out. Still the same problem.
>
>Can someone please suggest a solution?
>
>Thanks
>Sriram
>

--
Ceki For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp




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