log4j is capable of expanding system properties, so if your production environment sets a property for the directory which you would like to place the log files in, you can reference it from the log4j.properties file.
For example, we deploy webapps on Tomcat as well. Tomcat sets up a system property named catalina.base
which points to the Tomcat base directory. A log4j configuration that looks like this:
log4j.appender.f.File = ${catalina.base}/logs/myapp.log
Will result in the myapp.log
file being stored in the logs directory under the Tomcat install directory.