RE : RE : Redirecting the output to a log file
Maybe with debug=0 Anyway, u should use log4j instead of System.out -Message d'origine- De : Sarika N Inamdar [mailto:[EMAIL PROTECTED] Envoyé : mercredi 24 septembre 2003 06:41 À : 'Tomcat Users List' Objet : RE: RE : Redirecting the output to a log file Hi, Thanks for the solution. This works. Now my Servlets System.out is re-directed to log file. But I also see that tomcat logs lot of debug statements in the same debug. This would un-necessarily clutter our application log file. Is there a way we can filter tomcat System.out messages and log only our application System.out debug stmts ? Thanks for the help, Sarika -Original Message- From: Laurent Michenaud [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 4:13 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE : Redirecting the output to a log file Add a logger to your context and the following attribute : swallowOutput=true Your system.out will be redirected to the logger you defined for your context. Example : Context path= docBase=/home/adeuza debug=0 reloadable=true crossContext=true swallowOutput=true Logger className=org.apache.catalina.logger.FileLogger directory=/u/logs/ prefix=logfile. suffix=.log timestamp=true/ /Context -Message d'origine- De : Sarika N Inamdar [mailto:[EMAIL PROTECTED] Envoyé : mercredi 17 septembre 2003 12:40 À : 'Johan Louwers'; 'Tomcat Users List' Objet : RE: Redirecting the output to a log file Hi, But the servlet System.out code used to log messages to our application log when using tomcat 3. With migration to 4.1.24, we are facing this issue. Thanks, Sarika -Original Message- From: Johan Louwers [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:59 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Redirecting the output to a log file do not use System.out simply make a write to a file routine and write to a file :-) Johan. - Original Message - From: Sarika N Inamdar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:17 PM Subject: Redirecting the output to a log file Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE : Redirecting the output to a log file
Not really, that is why we all keep recommending commons-logging or log4j. -Tim Sarika N Inamdar wrote: Hi, Thanks for the solution. This works. Now my Servlets System.out is re-directed to log file. But I also see that tomcat logs lot of debug statements in the same debug. This would un-necessarily clutter our application log file. Is there a way we can filter tomcat System.out messages and log only our application System.out debug stmts ? Thanks for the help, Sarika - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE : Redirecting the output to a log file
Hi, Thanks for the solution. This works. Now my Servlets System.out is re-directed to log file. But I also see that tomcat logs lot of debug statements in the same debug. This would un-necessarily clutter our application log file. Is there a way we can filter tomcat System.out messages and log only our application System.out debug stmts ? Thanks for the help, Sarika -Original Message- From: Laurent Michenaud [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 4:13 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE : Redirecting the output to a log file Add a logger to your context and the following attribute : swallowOutput=true Your system.out will be redirected to the logger you defined for your context. Example : Context path= docBase=/home/adeuza debug=0 reloadable=true crossContext=true swallowOutput=true Logger className=org.apache.catalina.logger.FileLogger directory=/u/logs/ prefix=logfile. suffix=.log timestamp=true/ /Context -Message d'origine- De : Sarika N Inamdar [mailto:[EMAIL PROTECTED] Envoyé : mercredi 17 septembre 2003 12:40 À : 'Johan Louwers'; 'Tomcat Users List' Objet : RE: Redirecting the output to a log file Hi, But the servlet System.out code used to log messages to our application log when using tomcat 3. With migration to 4.1.24, we are facing this issue. Thanks, Sarika -Original Message- From: Johan Louwers [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:59 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Redirecting the output to a log file do not use System.out simply make a write to a file routine and write to a file :-) Johan. - Original Message - From: Sarika N Inamdar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:17 PM Subject: Redirecting the output to a log file Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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] - 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: Redirecting the output to a log file
do not use System.out simply make a write to a file routine and write to a file :-) Johan. - Original Message - From: Sarika N Inamdar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:17 PM Subject: Redirecting the output to a log file Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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: Redirecting the output to a log file
Hi, But the servlet System.out code used to log messages to our application log when using tomcat 3. With migration to 4.1.24, we are facing this issue. Thanks, Sarika -Original Message- From: Johan Louwers [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:59 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Redirecting the output to a log file do not use System.out simply make a write to a file routine and write to a file :-) Johan. - Original Message - From: Sarika N Inamdar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:17 PM Subject: Redirecting the output to a log file Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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 : Redirecting the output to a log file
Add a logger to your context and the following attribute : swallowOutput=true Your system.out will be redirected to the logger you defined for your context. Example : Context path= docBase=/home/adeuza debug=0 reloadable=true crossContext=true swallowOutput=true Logger className=org.apache.catalina.logger.FileLogger directory=/u/logs/ prefix=logfile. suffix=.log timestamp=true/ /Context -Message d'origine- De : Sarika N Inamdar [mailto:[EMAIL PROTECTED] Envoyé : mercredi 17 septembre 2003 12:40 À : 'Johan Louwers'; 'Tomcat Users List' Objet : RE: Redirecting the output to a log file Hi, But the servlet System.out code used to log messages to our application log when using tomcat 3. With migration to 4.1.24, we are facing this issue. Thanks, Sarika -Original Message- From: Johan Louwers [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:59 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Redirecting the output to a log file do not use System.out simply make a write to a file routine and write to a file :-) Johan. - Original Message - From: Sarika N Inamdar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:17 PM Subject: Redirecting the output to a log file Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirecting the output to a log file
Short term: try using swallowOutput=true. [Never used it myself] Long term: Switch to commons-logging or log4j. -Tim Sarika N Inamdar wrote: Hi, But the servlet System.out code used to log messages to our application log when using tomcat 3. With migration to 4.1.24, we are facing this issue. Thanks, Sarika -Original Message- From: Johan Louwers [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 3:59 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Redirecting the output to a log file do not use System.out simply make a write to a file routine and write to a file :-) Johan. - Original Message - From: Sarika N Inamdar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:17 PM Subject: Redirecting the output to a log file Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirecting the output to a log file
There is a log function which gets inherited from somewhere, but anyway, it should be there if you subclasses HttpServlet. The javadocs might just be usefull for the servlet specs :). On Wed, 17 Sep 2003, Sarika N Inamdar wrote: Hi All, When my servlets are sending some stack trace or System.out messages , all such output is dumped in the catalina.out log. We want the System.out messages to go into our application's log file. I am using standalone catalina on Solaris and tomcat 4.1.24. Please suggest on how to proceed to achieve the same. Thanks in Advance, Sarika - 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: redirecting the output to a log file
Hi Richards, I am already using file stream to write a log of my application specific info (and will move the application in next iteration to log4j). However i am having problem with capturing the error messages which catalina dumps if there is any error. They are appearing in the window in which catalina is running - since the scroll up immediatly, i could not read them, and they are not appearing in any of the log files under CATALINA_HOME\logs\ When i issued the bin\startup.bat a.out or bin\startup.bat 2a.err it only prints that tomcat started etc but not the error dump. Regards Satya - Original Message - From: Richard Plukker [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 17, 2002 9:20 PM Subject: Re: redirecting the output to a log file Hello Satya, I suggest Log4j. You can log to different out streams. You can configure the way you log outside you program code, using a log4j.properties file. @see http://jakarta.apache.org/log4j Also you can use the catalina way of logging. And you can make your own logging mechanism by appending to a java.io.RandomAccess file. But keep in mind that you have to programm a lot to make it thread safe etc. Good luck. Richard On Monday 17 June 2002 17:32, you wrote: Hi All, I am using catalina. When my servlets are sending some stack trace / debug output, all such output is dumped in the catalina window. I tried changing the logger class in server.xml, used startup 2output.txt etc but no technique is working, I am using standalone catalina on windows NT Please suggest Satya -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: redirecting the output to a log file
Satya wrote: Hi Richards, I am already using file stream to write a log of my application specific info (and will move the application in next iteration to log4j). However i am having problem with capturing the error messages which catalina dumps if there is any error. They are appearing in the window in which catalina is running - since the scroll up immediatly, i could not read them, and they are not appearing in any of the log files under CATALINA_HOME\logs\ When i issued the bin\startup.bat a.out or bin\startup.bat 2a.err it only prints that tomcat started etc but not the error dump. Regards Satya - Original Message - From: Richard Plukker [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 17, 2002 9:20 PM Subject: Re: redirecting the output to a log file Hello Satya, I suggest Log4j. You can log to different out streams. You can configure the way you log outside you program code, using a log4j.properties file. @see http://jakarta.apache.org/log4j Also you can use the catalina way of logging. And you can make your own logging mechanism by appending to a java.io.RandomAccess file. But keep in mind that you have to programm a lot to make it thread safe etc. Good luck. Richard On Monday 17 June 2002 17:32, you wrote: Hi All, I am using catalina. When my servlets are sending some stack trace / debug output, all such output is dumped in the catalina window. I tried changing the logger class in server.xml, used startup 2output.txt etc but no technique is working, I am using standalone catalina on windows NT Please suggest Satya -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Hello Satya, These messages are in catalina.out You can use tail -f catalina.out to see what is happening. Or if you work on windows, you should go to the properties of the dosbox and put the buffer size to 1000 lines than you can scroll up. good luck, Richard -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]