logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Creating log files relative to the web applications root directory?
Date Wed, 13 Aug 2003 12:47:14 GMT


>Ummmm, so basically then it is not possible to define a directory path
>the log4j.xml properties file so that log files are placed relative to
>web apps root directory?  Or for that matter relative to any known
>point like the server root directory?
>A problem we have is that we deploy .war files by sending the package
>server gods who then drop it into the webapps directory.  Alas we don't

This is a typical scenario.  As Senor Ebersole suggested, you would
reach agreement with the server admins on a particular directory or
other repository where you can log.  You would then use the System
property or JNDI approach I illustrated in previous messages in this
thread, except they set the property (or setup server.xml for JNDI), not
you.  Your app should complain and/or use a default setup
(BasicConfigurator.configure() for example) if this property is not

>based machine and the production servers are hosted on a flavor of
>Hard coding a directory path like "C:\..\" may work when doing the dev
>under Windows but just don't kind of cut it on a Unix file system when
>comes time to deployment.

Even if you didn't have a mixed system deployment, hard-coding is a bad
idea ;)

I would throw out one other type of option for this case: if you control
some servers, but not the ones you deploy to, you could have your apps
send logging messages to the servers you control, e.g. via a
SocketAppender or JMSAppender, or JDBCAppender even.  Then you can
figure out how to persist the messages yourself.

Yoav Shapira

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

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

View raw message