Re: **CONFIDENTIAL** Configuring Log4j in webapps
A rights problem is posssible, but unlikely given that the OS is some version of Windows. However, if the server that isn't working is running as a service, the default location for a relatively defined log file would be in C:\winnt\System32, which means your log file would be at C:\winnt\logs\mywebapplog.log (assuming the FileAppender would create the "logs" directory if it didn't exist already (I don't think it does). The reason it would work when running Tomcat's startup.bat file is that VM would have been started up in CATALINA_HOME\bin, so the location of the relatively defined log file would actually end up in CATALINA_HOME\logs. Make sense? Relatively defined paths will be relative to the directory where the VM started from. Services start from C:\winnt\System32 by default. This can be solved in one of two ways... 1. Use ${catalina.home}/logs/mywebapp.log. Tomcat generates this system property upon startup, and you can reference it in your config file 2. Tomcat's service can change the location of where the VM is started from. Just double click on tomcat5w.exe to see all the options. Change the startup location to wherever CATALINA_HOME\bin is to normalize it with starting Tomcat using CATALINA_HOME\bin\startup.bat Jake Quoting Parsons Technical Services <[EMAIL PROTECTED]>: > Sounds like a rights issue on the server. Make sure that the user that > tomcat is running with has the needed rights on the directory. > > If it is running as a service, you can still have a rights problem. > > If at some point in the path you do not have the proper rights, it can > prevent the use of relative paths. > > How are you starting Tomcat? Service or user? > > Doug > > > - Original Message - > From: "Ethan Cabiac" <[EMAIL PROTECTED]> > To: > Sent: Monday, February 07, 2005 9:23 AM > Subject: **CONFIDENTIAL** Configuring Log4j in webapps > > > > Hi everyone, > > > > I don't know if this is a Log4j problem or a Tomcat related issue but > > I > > am posting here first because I already subscribe to this mailing list ;). > > I have two (theoretically) identical Tomcat webservers (Tomcat 5.0), one > > on > > my local WinXP machine for dev/testing and one on the company's Win 2003 > > Server machine for production. When I setup my log4j files in my webapps > > I > > use: > > > > log4j.appender.A1.File=../logs/mywebapplog.log > > > > On my test machine this will work perfectly and even create the log file > > on > > Tomcat startup if it does not exist. On my production database it will not > > work if I use relative path, I actually have to specify > > C:/path_to_logs/mywebapplog.log and if the file is not there already then > > Tomcat complains on startup and no log gets written for the webapp. Like > > I > > said, the two Tomcats are supposed to be identical, but maybe there is a > > configuration discrepancy I missed, or maybe this is a Log4j thing? Any > > help > > is appreciated. > > > > -Ethan Cabiac > > > > > > > -- > > This message (including any attachments) contains confidential information > > intended for a specific individual and purpose, and is protected by law. > > > > If you are the intended recipient, this message is CONFIDENTIAL as per > > Contract. > > This message should not be disseminated to 3rd parties without prior > > written > > approval or consent from a Director of TRAX. Violation of Contract > > Terms constitute > > a breach and be cause for termination. > > > > If you are NOT the intended recipient, you should delete this message > > and are hereby > > notified that any disclosure, copying, or distribution of this > > message, or > > the taking of any action based on it, is strictly prohibited. > > > > - > 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]
Re: **CONFIDENTIAL** Configuring Log4j in webapps
Sounds like a rights issue on the server. Make sure that the user that tomcat is running with has the needed rights on the directory. If it is running as a service, you can still have a rights problem. If at some point in the path you do not have the proper rights, it can prevent the use of relative paths. How are you starting Tomcat? Service or user? Doug - Original Message - From: "Ethan Cabiac" <[EMAIL PROTECTED]> To: Sent: Monday, February 07, 2005 9:23 AM Subject: **CONFIDENTIAL** Configuring Log4j in webapps Hi everyone, I don't know if this is a Log4j problem or a Tomcat related issue but I am posting here first because I already subscribe to this mailing list ;). I have two (theoretically) identical Tomcat webservers (Tomcat 5.0), one on my local WinXP machine for dev/testing and one on the company's Win 2003 Server machine for production. When I setup my log4j files in my webapps I use: log4j.appender.A1.File=../logs/mywebapplog.log On my test machine this will work perfectly and even create the log file on Tomcat startup if it does not exist. On my production database it will not work if I use relative path, I actually have to specify C:/path_to_logs/mywebapplog.log and if the file is not there already then Tomcat complains on startup and no log gets written for the webapp. Like I said, the two Tomcats are supposed to be identical, but maybe there is a configuration discrepancy I missed, or maybe this is a Log4j thing? Any help is appreciated. -Ethan Cabiac -- This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are the intended recipient, this message is CONFIDENTIAL as per Contract. This message should not be disseminated to 3rd parties without prior written approval or consent from a Director of TRAX. Violation of Contract Terms constitute a breach and be cause for termination. If you are NOT the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
**CONFIDENTIAL** Configuring Log4j in webapps
Hi everyone, I don't know if this is a Log4j problem or a Tomcat related issue but I am posting here first because I already subscribe to this mailing list ;). I have two (theoretically) identical Tomcat webservers (Tomcat 5.0), one on my local WinXP machine for dev/testing and one on the company's Win 2003 Server machine for production. When I setup my log4j files in my webapps I use: log4j.appender.A1.File=../logs/mywebapplog.log On my test machine this will work perfectly and even create the log file on Tomcat startup if it does not exist. On my production database it will not work if I use relative path, I actually have to specify C:/path_to_logs/mywebapplog.log and if the file is not there already then Tomcat complains on startup and no log gets written for the webapp. Like I said, the two Tomcats are supposed to be identical, but maybe there is a configuration discrepancy I missed, or maybe this is a Log4j thing? Any help is appreciated. -Ethan Cabiac -- This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are the intended recipient, this message is CONFIDENTIAL as per Contract. This message should not be disseminated to 3rd parties without prior written approval or consent from a Director of TRAX. Violation of Contract Terms constitute a breach and be cause for termination. If you are NOT the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.