Quoting "Ranjan, Rajiv" <[EMAIL PROTECTED]>:

> Thanks for your response.
>
> I have also log4j properties file in WEB-INF/classes of the war file,
> which has following classpath.
>
>  log4j.appender.Servlet.File=servlet.log
>

What do you mean by "the following classpath"?  You mean "path"?  In any case,
specifying the file without a path would put the servlet.log file in the same
directory as the JVM was started.


> Properties file which is passed as a JAVA_ARGS has the different entry ,
> which is given below
>
> log4j.appender.Servlet.File=/log/CCAR_TRN1/sybnservlet/servlet.log
>

What I was trying to get at was whether you've specified the JAVA_ARGS entry
properly for Log4j to find the properties file.  If you don't know that for
sure, you need to find that out first.  Assuming it is specified correctly and
Log4j actually is loading the properties file, does the path
"/log/CCAR_TRN1/sybnservlet/" already exist on the system?  If not, Log4j won't
create it for you and that would explain why you don't see the servlet.log file
in that path.

> Do you think this is a root cause which does not allow to create the log
> files.
>

There is another issue here.  You were using Weblogic, right?  If so, unless you
specifically configure the webapp to use parent-last classloading behavior, your
webapp will be sharing the same logger repository as the server.  If you
configure Log4j once at the server level and then perform a manual
configuration when your webapp loads (auto-configuration only happens once per
instance of Log4j) and use different configuration files in each case, you may
be blowing away your server's configuration with that of your webapp.  You can
solve this in a few ways....

1.  Configure the webapp to use parent-last classloading behavior and add
log4j.jar to WEB-INF/lib and the config file to WEB-INF/classes.  This isolates
the instance of Log4j used by the webapp so it doesn't affect the server's Log4j
instance.

2.  Use a repository selector.  This is similar to #1, but it allows you to use
a single Log4j instance.

3.  Don't perform manual configuration in your webapp.  Just use the config that
the server provides.  That way, you won't accidentally blow a previous config
away.


Jake

> Regards
>
> Rajiv
>
> -----Original Message-----
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 24, 2005 11:54 PM
> To: Log4J Users List
> Subject: Re: Log file does not gets created with log4j
>
> At 09:08 AM 5/24/2005 -0500, you wrote:
>  >You could try writing your log to the root for a start and work you
> >way to the correct location.
>  >
>  >og4j.appender.Servlet.File=/servlet.log
>  >
>
> Why not start by simply making sure that logging is working at all using
> a ConsoleAppender.  Is there any Log4j output?  If not, then you might
> check whether the log4j.properties file passed "as JAVA_ARGS" is
> actually getting discovered by Log4j.  Start simple.  Once that works,
> you can add complexity as needed.
>
> Jake
>
>  >On 5/24/05, Ranjan, Rajiv <[EMAIL PROTECTED]> wrote:
>  >> Logs file does not gets created on the given location in log4j  >>
> properties file.
>  >>
>  >> log4j.appender.Servlet.File=/log/CCAR_TRN1/sybnservlet/servlet.log
>  >>
>  >> I have log4j.jar file in the weblogic server classpath, also passed
> >> log4j.properties file as JAVA_ARGS.
>  >>
>  >> Still not working.
>  >>
>  >> Any help will be appreciated.
>  >>
>  >> Thanks
>  >>
>  >> Rajiv Ranjan
>  >> > EDS-Electronics Data Systems (India)  >> >
> _______________________________  >> > DLF Plaza Tower, DLF City Phase -
> I,  >> > Gurgaon - 122002, Haryana, India  >> > *:  +91-124-519-7716  >>
> >  Mobile: +91-9811860047  >> pager: [EMAIL PROTECTED]  >>
> > email : [EMAIL PROTECTED]  >> > Jabber IM: [EMAIL PROTECTED]
> >> > web: www.eds.com  >> >  >> >  >>  >>  >  >
>  >--
>  >James Stauffer
>  >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]
>
> ---------------------------------------------------------------------
> 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