logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James A. N. Stauffer" <stauffer.ja...@gmail.com>
Subject Re: Location of Log4J file in web application
Date Thu, 04 Oct 2007 21:07:25 GMT
I use Tomcat and I can set system properties.  I would be very
surprise if you can't set system properties on WebLogic.  This might
not work if you aren't given the rights to set system properties.

On 10/4/07, Ashish Kulkarni <ashish.kulkarni13@gmail.com> wrote:
> Hi
> But will this work in web application also, for example i am installing
> software on web logic, or websphere, will this work
>
> Ashis
> On 10/4/07, James A. N. Stauffer <stauffer.james@gmail.com> wrote:
> >
> > If you set a system property it can be used in your log4j.xml.
> > <param name="File" value="${log4jXmlFilter}"/>
> >
> > You your machine run java with -Dlog4jXmlFilter=C:/Documents and
> > Settings/Kulkara/My
> >
> > Documents/ashish/code/workspace5.1M/version6300build12-00/log4jXmlFilter.log
> >
> > On 10/4/07, Ashish Kulkarni <ashish.kulkarni13@gmail.com> wrote:
> > > Hi
> > > How do we set the log file location dyanamically in web application,
> > > Currently i am using log4j.xml file with following definiation, this
> > file is
> > > under WEB-INF file
> > > <appender name="A2" class=" org.apache.log4j.DailyRollingFileAppender">
> > > <param name="File"
> > > value="C:\\Documents and Settings\\Kulkara\\My
> > >
> > Documents\\ashish\\code\\workspace5.1M\\version6300build12-00\\log4jXmlFilter.log"
> > > />
> > > ... </appender>
> > > and in load the this xml file in Servlet using
> > > String fileName = config.getInitParameter(log4j.xml);
> > > ServletContext oCtx = config.getServletContext();
> > > URL path = oCtx.getResource (fileName);
> > > DOMConfigurator.configure(path);
> > >
> > > But if i have to install this on unix, i have to change the path, also
> > the
> > > server on which i will install this may not have the folder, so i will
> > have
> > > to recreate a war file
> > > So is there a dynamic way of telling log4j the location and name of log
> > > file? which can work on any system.
> > > i would prefer the log file to be under the same folder application is
> > > installed
> > >
> > > Ashish
> > >
> >
> >
> > --
> > James A. N. Stauffer        http://www.geocities.com/stauffer_james/
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>


-- 
James A. N. Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message