RE: Logging and Deployment best practices
Hi, >speaking of which yoav, it's been a little while since i first submitted a >doc patch for 5.5's logging page and it's not been made live yet .. is this >a painful procedure ;) :) As the Bugzilla comments said, your patch (a modified version thereof, actually) has been committed. The changes will be visible at the same time as any other patch: that is, in the next release. And to pre-empt the next question, there's no designate release schedule. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging and Deployment best practices
Phillip Qin writes: Hi, I don't think the log will go to system32 directory. Try something like this log4j.appender.file.File=${catalina.home}/logs/lciponline_debug.txt It will when I just do this, though: log4j.appender.file.File=lciponline_debug.txt Using the environment variable was the trick that I didn't know about. Thanks for your answer! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logging and Deployment best practices
speaking of which yoav, it's been a little while since i first submitted a doc patch for 5.5's logging page and it's not been made live yet .. is this a painful procedure ;) :) Allistair > -Original Message- > From: Paul Christmann [mailto:[EMAIL PROTECTED] > Sent: 23 November 2004 15:51 > To: Tomcat Users List > Subject: Re: Logging and Deployment best practices > > > Shapira, Yoav writes: > > Loggers are gone in Tomcat 5.5. > > One gentle suggestion: Is it possible make a note of that in > the server > configuration documentation? I was reading > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/logger. html and was just getting interested in them before reading a post on the topic this morning. Thanks again, PC - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logging and Deployment best practices
Hi, >One gentle suggestion: Is it possible make a note of that in the server >configuration documentation? I was reading >http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/logger.html and was >just getting interested in them before reading a post on the topic this >morning. If we were to start peppering the docs for version X (e.g 5.0) with references to how a feature is handled in versions Y (e.g. 3.x, 4.x) and Z (5.5.x) as well, the docs would become a real mess (look at the changelogs to get an idea of how much would be added), and I think more people would be confused than helped. You should consult the changelogs before upgrading: that's where information such as Loggers being removed is covered. If unsure or unclear, you have resources like this mailing list. Yoav Shapira http://www.yoavshapira.com 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging and Deployment best practices
Shapira, Yoav writes: Loggers are gone in Tomcat 5.5. One gentle suggestion: Is it possible make a note of that in the server configuration documentation? I was reading http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/logger.html and was just getting interested in them before reading a post on the topic this morning. Thanks again, PC - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging and Deployment best practices
On Tue, 23 Nov 2004 10:14:24 -0500, Shapira, Yoav <[EMAIL PROTECTED]> wrote: >a) Convert my log4j.properties file to use a RollingFileAppender. I This is good. >I'd rather use a relative path (something like ./logs) and >have the logs all end up in %TOMCAT_HOME%/logs. Log4j configuration files can have environment variables in them, e.g. ${CATALINA_HOME}/logs/mylog.txt. Alternatively, you could use programmatic configuration instead of log4j.properties. Cool! I guess it pays to know where to look. I've been digging through Tomcat documentation to find an answer, when I guess I needed to read the log4j documentation. I want to stay away from programmatic configuration of log4j, and just use property files. Using an environment variable gives me the flexibility I need. Thanks for your answers! -- PC Paul Christmann Prior Artisans, LLC mailto:[EMAIL PROTECTED] 504-587-9072 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logging and Deployment best practices
> But I finally decided as I was upgrading Tomcat that I'd address that > problem by moving to a rolling file appender. Seems to me that I have > two choices for doing this: we find the rolling file appenders useful as you can specify periodcity and they rename themselves to dated filenames. you can then manage those files however you like. > a) Convert my log4j.properties file to use a RollingFileAppender. I > did this, and much to my surprise the log files showed up in my > %WIN_HOME%/system32 folder. we put a placeholder in the log4j.properties file ${log4j.home} that gets replaced with Ant when the build task is called either for development or production. That means we have separate properties files for dev and prod configs and the log4j.home parameter is actually a full path. You could adapt this to your own scenarios. I've never gotten by default the log4j file logs into tomcat's logs either, so use this other method. > b) Leave my log4j.properties file using ConsoleAppender and use a > element in my to have Tomcat put the output into a > file. I have not tried this yet, and wanted to post this query before > digging further into it. Is this a good alternative? I have two > issues with it: Yeah probably not a good logging stategy considering it's gone ;) And anyways, that stuff was only for specific types of logging info that will now come through in stdout. Allistair. --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logging and Deployment best practices
Hi, I don't think the log will go to system32 directory. Try something like this log4j.rootLogger=INFO, fatalconsole, file | | log4j.appender.file=org.apache.log4j.DailyRollingFileAppender log4j.appender.file.File=${catalina.home}/logs/lciponline_debug.txt log4j.appender.file.DatePattern='.'-MM-dd log4j.appender.file.Threshold=DEBUG -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: November 23, 2004 10:14 AM To: Tomcat Users List Subject: RE: Logging and Deployment best practices Hi, >a) Convert my log4j.properties file to use a RollingFileAppender. I This is good. >AppDirectory inside Parameters using the Registry Editor), I couldn't >figure out how to change the home directory for Tomcat running as a Relying on the home directory is bad. >logging; I'd rather use a relative path (something like ./logs) and >have the logs all end up in %TOMCAT_HOME%/logs. Log4j configuration files can have environment variables in them, e.g. ${CATALINA_HOME}/logs/mylog.txt. Alternatively, you could use programmatic configuration instead of log4j.properties. >b) Leave my log4j.properties file using ConsoleAppender and use a > element in my to have Tomcat put the output into a This is also bad. Loggers are gone in Tomcat 5.5. I realize it might also take 2 years for you to go from 5.0 to 5.5, just like it did from 4.1 to 5.0, but still it doesn't make sense to design something relying on at this point. >+ Put all of the responsibility into the webapp using log4j? If so - Yes. This maximizes portability, container-independence, and control for you. >how can I configure the home directory of Tomcat when I install the You can, but shouldn't anyways. Forget about any design based upon a "home directory" or "current working directory" location. >Service? Or should I hardwire some other location for the logs? You can, but don't have to. If you have a logging directory for everything running on the production server, you can hard-wire that. Yoav Shapira http://www.yoavshapira.com 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:41a35416244686896713316!
RE: Logging and Deployment best practices
Hi, >a) Convert my log4j.properties file to use a RollingFileAppender. I This is good. >AppDirectory inside Parameters using the Registry Editor), I couldn't >figure out how to change the home directory for Tomcat running as a Relying on the home directory is bad. >logging; I'd rather use a relative path (something like ./logs) and >have the logs all end up in %TOMCAT_HOME%/logs. Log4j configuration files can have environment variables in them, e.g. ${CATALINA_HOME}/logs/mylog.txt. Alternatively, you could use programmatic configuration instead of log4j.properties. >b) Leave my log4j.properties file using ConsoleAppender and use a > element in my to have Tomcat put the output into a This is also bad. Loggers are gone in Tomcat 5.5. I realize it might also take 2 years for you to go from 5.0 to 5.5, just like it did from 4.1 to 5.0, but still it doesn't make sense to design something relying on at this point. >+ Put all of the responsibility into the webapp using log4j? If so - Yes. This maximizes portability, container-independence, and control for you. >how can I configure the home directory of Tomcat when I install the You can, but shouldn't anyways. Forget about any design based upon a "home directory" or "current working directory" location. >Service? Or should I hardwire some other location for the logs? You can, but don't have to. If you have a logging directory for everything running on the production server, you can hard-wire that. Yoav Shapira http://www.yoavshapira.com 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Logging and Deployment best practices
We've recently upgraded from 4.1, which we've been using for 2+ years, to 5.0.28. While doing this, I've been looking into our logging in order to try and do things better. And I'm curious what other people do - if there are any "best practices" that I could follow. What we do today: We use log4j (wrapped inside commons logging) in our webapps. Each war file includes a jar that has a log4j.properties file which controls logging from that webapp. We use the log4j ConsoleAppender so that all of our log messages ended up in the tomcat stdout.log file. It was always a minor annoyance that we had to manually back up those files when we did a restart of the service (we are using W2K and XP servers). But I finally decided as I was upgrading Tomcat that I'd address that problem by moving to a rolling file appender. Seems to me that I have two choices for doing this: a) Convert my log4j.properties file to use a RollingFileAppender. I did this, and much to my surprise the log files showed up in my %WIN_HOME%/system32 folder. Try as I might (for example, setting AppDirectory inside Parameters using the Registry Editor), I couldn't figure out how to change the home directory for Tomcat running as a Service. We have different installation of Tomcat on different servers, so I can't (nor do I want to) use a full path for the logging; I'd rather use a relative path (something like ./logs) and have the logs all end up in %TOMCAT_HOME%/logs. b) Leave my log4j.properties file using ConsoleAppender and use a element in my to have Tomcat put the output into a file. I have not tried this yet, and wanted to post this query before digging further into it. Is this a good alternative? I have two issues with it: i) I just saw another post that indicated that this functionality is being removed in 5.5. Seems like the wrong time for me to start using functionality that has already been removed from future versions. ii) We use ant tasks to deploy our war files to multiple contexts. We have never included a context.xml in our webapps, instead getting the "default" behavior when we deploy. If I included a context.xml in the war file, then I can't deploy the exact same war (checked out from CVS) to a new context without modifying it. Or can I? (Sorry - the whole META-INF/context.xml is very new to me. I only started reading about it yesterday). We do deploy the same war file to different contexts: for development and staging environments. So: what is the "right" approach for file logging in a webapp under Tomcat? + Put all of the responsibility into the webapp using log4j? If so - how can I configure the home directory of Tomcat when I install the Service? Or should I hardwire some other location for the logs? + Or use the logging functionality of Tomcat via elements? If so - how do I manage deploying the same webapp to different context paths? + Some other alternative? Thanks for any insights, -- PC Paul Christmann Prior Artisans, LLC mailto:[EMAIL PROTECTED] 504-587-9072 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]