Hi , thank you all for your replies, I have solved the problem with relativ path by setting a JVM-Option.
I will also set a JVM-Option to tell Tomcat where to find my log4j.config.xml but he tell me, that he can´t find it!? -Dlog4j.configuration=C:\\projects\\sources\\xxx\\WebContent\\ WEB-INF\\log4j.config.xml Do I make something wrong? Some Idea??? See the output of tomcat: Thanks Thomas Starting service Tomcat-Standalone Apache Tomcat/4.1.24 log4j: Trying to find [C:\\projects\\sources\\PDMWebConnector\\WebContent\\WEB-INF\\log4j.config.x ml] using context classloader WebappClassLoader available: Extension[commons-discovery, implementationVendor=The Apache Software Foundation, implementationVendorId=, implementationVersion=0.2-dev, specificationVendor=The Apache Software Foundation, specificationVersion=] Extension[org.apache.commons.logging, implementationVendor=Apache Software Foundation, implementationVersion=1.0.3, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.3, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.3] Extension[org.saxpath, implementationVendor= werken digital., implementationVersion=1.0, specificationVendor=werken digital., specificationVersion=1.0 FCS] delegate: false repositories: /WEB-INF/classes/ required: ----------> Parent Classloader: StandardClassLoader available: delegate: true repositories: file:C:\jakarta-tomcat-4.1.24\shared\classes\ required: ----------> Parent Classloader: StandardClassLoader available: Extension[org.apache.tools.ant, implementationVendor=Apache Software Foundation, implementationVersion=1.5.1, specificationVendor=Apache Software Foundation, specificationVersion=1.5.1] Extension[org.apache.commons.collections, implementationVendor=Apache Software Foundation, implementationVersion=2.1, specificationVendor=Apache Software Foundation, specificationVersion=2.1] Extension[org.apache.commons.dbcp, implementationVendor=Apache Software Foundation, implementationVersion=1.0, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[org.apache.commons.logging, implementationVendor=Apache Software Foundation, implementationVersion=1.0.2, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[org.apache.commons.pool, implementationVendor=Apache Software Foundation, implementationVersion=1.0.1, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2] delegate: true repositories: file:C:\jakarta-tomcat-4.1.24\common\classes\ file:C:\jakarta-tomcat-4.1.24\common\endorsed\xercesImpl.jar file:C:\jakarta-tomcat-4.1.24\common\endorsed\xmlParserAPIs.jar file:C:\jakarta-tomcat-4.1.24\common\lib\activation.jar file:C:\jakarta-tomcat-4.1.24\common\lib\ant.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-collections.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-dbcp.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-logging-api.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-pool.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jasper-compiler.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jasper-runtime.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jdbc2_0-stdext.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jndi.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jta.jar file:C:\jakarta-tomcat-4.1.24\common\lib\mail.jar file:C:\jakarta-tomcat-4.1.24\common\lib\naming-common.jar file:C:\jakarta-tomcat-4.1.24\common\lib\naming-factory.jar file:C:\jakarta-tomcat-4.1.24\common\lib\naming-resources.jar file:C:\jakarta-tomcat-4.1.24\common\lib\servlet.jar required: ----------> Parent Classloader: [EMAIL PROTECTED] . log4j: Trying to find [C:\\projects\\sources\\PDMWebConnector\\WebContent\\WEB-INF\\log4j.config.x ml] using WebappClassLoader available: Extension[commons-discovery, implementationVendor=The Apache Software Foundation, implementationVendorId=, implementationVersion=0.2-dev, specificationVendor=The Apache Software Foundation, specificationVersion=] Extension[org.apache.commons.logging, implementationVendor=Apache Software Foundation, implementationVersion=1.0.3, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.3, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.3] Extension[org.saxpath, implementationVendor= werken digital., implementationVersion=1.0, specificationVendor=werken digital., specificationVersion=1.0 FCS] delegate: false repositories: /WEB-INF/classes/ required: ----------> Parent Classloader: StandardClassLoader available: delegate: true repositories: file:C:\jakarta-tomcat-4.1.24\shared\classes\ required: ----------> Parent Classloader: StandardClassLoader available: Extension[org.apache.tools.ant, implementationVendor=Apache Software Foundation, implementationVersion=1.5.1, specificationVendor=Apache Software Foundation, specificationVersion=1.5.1] Extension[org.apache.commons.collections, implementationVendor=Apache Software Foundation, implementationVersion=2.1, specificationVendor=Apache Software Foundation, specificationVersion=2.1] Extension[org.apache.commons.dbcp, implementationVendor=Apache Software Foundation, implementationVersion=1.0, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[org.apache.commons.logging, implementationVendor=Apache Software Foundation, implementationVersion=1.0.2, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[org.apache.commons.pool, implementationVendor=Apache Software Foundation, implementationVersion=1.0.1, specificationVendor=Apache Software Foundation, specificationVersion=1.0] Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2] delegate: true repositories: file:C:\jakarta-tomcat-4.1.24\common\classes\ file:C:\jakarta-tomcat-4.1.24\common\endorsed\xercesImpl.jar file:C:\jakarta-tomcat-4.1.24\common\endorsed\xmlParserAPIs.jar file:C:\jakarta-tomcat-4.1.24\common\lib\activation.jar file:C:\jakarta-tomcat-4.1.24\common\lib\ant.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-collections.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-dbcp.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-logging-api.jar file:C:\jakarta-tomcat-4.1.24\common\lib\commons-pool.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jasper-compiler.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jasper-runtime.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jdbc2_0-stdext.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jndi.jar file:C:\jakarta-tomcat-4.1.24\common\lib\jta.jar file:C:\jakarta-tomcat-4.1.24\common\lib\mail.jar file:C:\jakarta-tomcat-4.1.24\common\lib\naming-common.jar file:C:\jakarta-tomcat-4.1.24\common\lib\naming-factory.jar file:C:\jakarta-tomcat-4.1.24\common\lib\naming-resources.jar file:C:\jakarta-tomcat-4.1.24\common\lib\servlet.jar required: ----------> Parent Classloader: [EMAIL PROTECTED] class loader. log4j: Trying to find [C:\\projects\\sources\\PDMWebConnector\\WebContent\\WEB-INF\\log4j.config.x ml] using ClassLoader.getSystemResource(). log4j: Could not find resource: [C:\\projects\\sources\\PDMWebConnector\\WebContent\\WEB-INF\\log4j.config.x ml]. log4j:WARN No appenders could be found for logger (org.apache.axis.transport.http.AxisServlet). log4j:WARN Please initialize the log4j system properly. -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 3. November 2004 15:32 An: [EMAIL PROTECTED] Betreff: Re: AW: AW: log4j help pls Hi Thomas, You do not need to have the first \\ charactes as this makes it an actual path rather than a relative path so it should be <appender name="client" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="logs\\client.log"/> BTW just use a single forward slash instead of the double back slash it will be easier to read.. Regards Steve Quoting "Dorner, Thomas" <[EMAIL PROTECTED]>: > > Hi Steve, > > I can set the position of my log4j.config.xml in the classpath so the > log4j.config.xml can be placed everywhere - right? > > So I define my appender like this: > > <appender name="client" class="org.apache.log4j.RollingFileAppender"> > <param name="File" value="\\logs\\client.log"/> > > And make a directory /logs under /WEB-INF. > > Do you think it will work this way? > > I haven´t much success with testing! :( > > Thanks Thomas > > PS: Thank you for your tip with config, you are right! > > > -----Ursprüngliche Nachricht----- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 3. November 2004 14:19 > An: [EMAIL PROTECTED] > Betreff: Re: AW: log4j help pls > > Hi Thomas, > > > Your log4j properties file only needs to be located via the class path so in > > your case it should be put in the WEB-INF/classes directoy. Else you have > specified a path somewhere (probably in a servlet property in your web.xml > file) > > You should not be putting your context logging into the Tomcat log > directory. > This directory contains logs for the tomcat server and not your web context. > > I suggest that you create a log directory in your WEB-INF directoy and use a > > relative path for your log file as log. > > Anything you put under the WEB-INF directy is unavailable to clients of your > > web context and it keeps all your contect information in one place. > > If you still want to use a config directy and identiy this in your web.xml > file > then I also suggest it goes under the WEB-INF/config directory. Otherwise > you > run the risk of not configuring Tomcat correctly and allowing directories > within your web context to be traversed by clients and they can then see the > > contents of your configuration and logs. > > Regards > > Steve > > > Quoting "Dorner, Thomas" <[EMAIL PROTECTED]>: > > > Hi Steve, > > > > Thank you for your fast reply! > > > > >If you are using from a WEB Context it will be a relative path from the > > >WEB-INF/ directory of your web context > > > > I have a Web-Application with the following path: > > C:\jakarta-tomcat-4.1.24\webapps\PDMWebConnector\WEB-INF\classes > > > > My log4j.config runs in: > > C:\jakarta-tomcat-4.1.24\webapps\PDMWebConnector\config\ > > > > So, if I want to log in: > > C:\jakarta-tomcat-4.1.24\logs\ > > I had to define the relative path like this: > > ..\\..\\..\\logs\\appender.xml ???? > > > > > > Can you please tell me if I am right? > > Or does it depends on the directory where log4j.config.xml was placed? > > > > Thanks > > Thomas > > > > > > > > > > > > -----Ursprüngliche Nachricht----- > > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Gesendet: Mittwoch, 3. November 2004 13:50 > > An: [EMAIL PROTECTED] > > Betreff: Re: log4j help pls > > > > The short answer is yes. > > > > Don't put the absolute path name just a relative path name. > > > > This has a affect depending on the context. > > > > If it is a stand alone application it will be a relative path from the > > directory in which you started the application. > > > > If you are using from a WEB Context it will be a relative path from the > WEB- > > INF/ directory of your web context > > > > > > > > Regards > > > > Steve > > > > > > Quoting "Dorner, Thomas" <[EMAIL PROTECTED]>: > > > > > Hi all, > > > > > > > > > > > > I am sorry for asking this non axis question, but I cant find a solution > > > whenn googling. > > > > > > > > > > > > I use log4j in my project and so I have the log4j.config.xml and > therefore > > > the appenders. > > > > > > The appender do have a attribute name="File" and a value="C:\\..\\..\\" > > with > > > the absolute path, > > > > > > Which define where log4j writes the log-file. > > > > > > > > > > > > My question is, is it possible to define/describe a relativ path where > > log4j > > > write the log-file???? > > > > > > > > > > > > > > > > > > <appender name="webservices" > class="org.apache.log4j.RollingFileAppender"> > > > > > > <param name="File" > > > value="C:\\projects\\sources\\PDMWebConnector\\logs\\webservices.log"/> > > > > > > <param name="MaxFileSize" value="1000KB"/> > > > > > > > > > > > > > > > > > > Thanks in advance > > > > > > Thomas > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >