RE: log files with servlets ?
For how to set up logging of your Java servlet code on 5.0.28, you need to add a Logger to your conf/server.xml file, inserting it inside your Host.../Host or Engine.../Engine tags will probably get you going. To get apache-httpd type logging going, you need a Valve, again insert it within your Engine or Host tags, looks a bit like this: Valve className=org.apache.catalina.valves.FastCommonAccessLogValve directory=logs prefix=access_log_ suffix=.log pattern=common resolveHosts=false/ Do you have doPost method() implemented in your servlet class? If you only have doGet(), that is most likely your problem. -Original Message- From: Jean-Luc Douville [mailto:[EMAIL PROTECTED] Sent: Wednesday 25 May 2005 09:53 To: tomcat-user@jakarta.apache.org Subject: log files with servlets ? I am testing MIDlets connection to servlet. I am using Netbeans 4.1 with mobility pack, Tomcat bundled with NB (5.5.7) or external Tomcat (5.028). I have added an EchoServlet under TomcatServletExample (Servlet v 2.3). My EchoServlet can respond to POST and GET methods. It is OK when i send parameters from a browser with GET method. With POST method from a MIDlet, i cannot reach the servlet (the HttpConnexion seems no connect ...) My first question : how can i find or trace log events which relate to that servlet or tomcat ? I want to trace the access of my MIDlet to tomcat and to the servlet... but i don't find any log file about, except the TOMCAT_HOME/logs/TomcatServletExample.2005-05-xx.log (which describes the starting of the servlet). Can i find or initiate any log file similar to the .../httpd/access_log of my apache web site ? Thanks. -- Jean-Luc Douville - 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: log files with servlets ?
If you don't want to mess with your server.xml file, or you're a mere user and can't, you can do it easily with Apache log4j. Create the following file, log4j.properties and put it in your WEB-INF/classes directory. This will create a log file in /var/tmp named logtags.log. The docs for log4j are at http://logging.apache.org/log4j/docs/ # Sample properties to initialise log4j log4j.rootCategory=debug, logfile log4j.appender.logfile=org.apache.log4j.RollingFileAppender log4j.appender.logfile.File=/var/tmp/logtags.log log4j.appender.logfile.MaxFileSize=100KB log4j.appender.logfile.MaxBackupIndex=2 log4j.appender.logfile.layout=org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern=%p %t %c - %m%n - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log files
Built in to Tomcat, no and no. It is possible to rotate logs by using some scripting and stopping/starting the server. I don't believe there is any way to limit the log file size without modifying the Tomcat source. Randy -Original Message- From: John Michael Luy [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 05, 2001 8:21 PM To: [EMAIL PROTECTED] Subject: log files is there a way to rotate logs for tomcat-3.2.2. can you limit the size of the logfile within tomcat?
RE: log files in tomcat
There should be two more logs: jvm.stderr jvm.stdout The latter is logging System.out.println -Original Message- From: Ross Manges [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 1:44 PM To: [EMAIL PROTECTED] Subject: log files in tomcat Hello folks, I apologize in advance for this dumb question, but I'm having an exteremly difficult time getting tomcat to create a log file containing the event traces (and possibly System.out.println()'s?) from my servlets. I've read up on the available faq's and other documentation, which directs me to the server.xml file. I've set that file to maximum debugging mode, but still no luck. I get two files in my /log directory: jasper.log and servlet.log. The latter contains nearly nothing, and jasper.log simply reports on my jsp files. Can somebody PLEASE point me in the right direction? If I've missed some important set of documentation please let me know. Thanks! --Ross p.s. - I'm running tomcat 3.2.1 standalone on WinMe, PIII-700, 128mb ram. __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: log files in tomcat
I have modified my tomcat.sh/bat file to have java org.apache.whatever.tomcat start 1/path/to/logs/stdout.log 21 So when you startup tomcat , the stdout and stderr go to a file. But since you are using windows, I am not very sure about the syntax. just a file.log may redirect both System.out.println and System.err.println to the same file. Hope this helps Regards Shahed. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: log files in tomcat
The solution it's on server.xml file it self, here it's an excerpt... 8-- !-- if you don't want messages on screen, add the attribute path="logs/tomcat.log" to the Logger element below -- Logger name="tc_log" verbosityLevel = "INFORMATION" / 8-- So to get tomcat screen logged into a file change the Logger element for the "tc_log" log in server.xml to this: 8-- Logger name="tc_log" verbosityLevel = "INFORMATION" path="logs/tomcat.log" / 8-- Saludos , Ignacio J. Ortega -Mensaje original- De: Ross Manges [mailto:[EMAIL PROTECTED]] Enviado el: mircoles 31 de enero de 2001 20:44 Para: [EMAIL PROTECTED] Asunto: log files in tomcat Hello folks, I apologize in advance for this dumb question, but I'm having an exteremly difficult time getting tomcat to create a log file containing the event traces (and possibly System.out.println()'s?) from my servlets. I've read up on the available faq's and other documentation, which directs me to the server.xml file. I've set that file to maximum debugging mode, but still no luck. I get two files in my /log directory: jasper.log and servlet.log. The latter contains nearly nothing, and jasper.log simply reports on my jsp files. Can somebody PLEASE point me in the right direction? If I've missed some important set of documentation please let me know. Thanks! --Ross p.s. - I'm running tomcat 3.2.1 standalone on WinMe, PIII-700, 128mb ram. __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: log files in tomcat
Actually, these are files that are generated by the jk_nt_service helper application, not entries in tomcat. If you want to capture the output of tomcat, you need to either a) redirect the output to a file (on Unix you also need to redirect stderr, on Windows stdout and stderr are much the same (I think)) or b) programatically change the stream pointed to by System.out and .err to something else which you have opened. -Original Message- From: Jason Pell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 8:09 PM To: [EMAIL PROTECTED] Subject: Re: log files in tomcat I have also had problems with this. As suggested I tried adding jvm.stderr and jvm.stdout logs to server.xml: - server.xml fragment --- Logger name="jvm.stderr" verbosityLevel = "DEBUG" path="logs/stderr.log" / Logger name="jvm.stdout" verbosityLevel = "DEBUG" path="logs/stdout.log" / - server.xml fragment --- But no joy I am afraid. Is this the correct config info. I am running Tomcat 3.2.1 on Redhat 6.2 Thanks Jason "Garmaev, Vladimir A" wrote: There should be two more logs: jvm.stderr jvm.stdout The latter is logging System.out.println -Original Message- From: Ross Manges [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 1:44 PM To: [EMAIL PROTECTED] Subject: log files in tomcat Hello folks, I apologize in advance for this dumb question, but I'm having an exteremly difficult time getting tomcat to create a log file containing the event traces (and possibly System.out.println()'s?) from my servlets. I've read up on the available faq's and other documentation, which directs me to the server.xml file. I've set that file to maximum debugging mode, but still no luck. I get two files in my /log directory: jasper.log and servlet.log. The latter contains nearly nothing, and jasper.log simply reports on my jsp files. Can somebody PLEASE point me in the right direction? If I've missed some important set of documentation please let me know. Thanks! --Ross p.s. - I'm running tomcat 3.2.1 standalone on WinMe, PIII-700, 128mb ram. __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] -- Jason Pell Senior Analyst/Programmer - Web Developer Deakin Software Services Pty Ltd 12 Gheringhap St, Geelong Victoria 3220 Australia Phone: 03 5227 8858 International: +61 3 5227 8858 Fax: 03 5227 8907 International: +61 3 5227 8907 E-mail [EMAIL PROTECTED] http://www.dssonline.com.au Customer Support Hotline: 1800 620 497 "Callista - the brightest solution in university management" --- Important Notice: The contents of this email transmission, including attachments, may be privileged and confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this transmission in error, please advise the sender by return email or telephone immediately and destroy all versions. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: log files in tomcat
Perhaps we should take this as a suggested improvement to tomcat: If they are present, then redirect System.out and System.err to these logfiles. "Garmaev, Vladimir A" wrote: There should be two more logs: jvm.stderr jvm.stdout The latter is logging System.out.println CPC Livelink Admin wrote: Actually, these are files that are generated by the jk_nt_service helper application, not entries in tomcat. If you want to capture the output of tomcat, you need to either a) redirect the output to a file (on Unix you also need to redirect stderr, on Windows stdout and stderr are much the same (I think)) or b) programatically change the stream pointed to by System.out and .err to something else which you have opened. -Original Message- From: Jason Pell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 8:09 PM To: [EMAIL PROTECTED] Subject: Re: log files in tomcat I have also had problems with this. As suggested I tried adding jvm.stderr and jvm.stdout logs to server.xml: - server.xml fragment --- Logger name="jvm.stderr" verbosityLevel = "DEBUG" path="logs/stderr.log" / Logger name="jvm.stdout" verbosityLevel = "DEBUG" path="logs/stdout.log" / - server.xml fragment --- But no joy I am afraid. Is this the correct config info. I am running Tomcat 3.2.1 on Redhat 6.2 Thanks Jason "Garmaev, Vladimir A" wrote: There should be two more logs: jvm.stderr jvm.stdout The latter is logging System.out.println -Original Message- From: Ross Manges [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 1:44 PM To: [EMAIL PROTECTED] Subject: log files in tomcat Hello folks, I apologize in advance for this dumb question, but I'm having an exteremly difficult time getting tomcat to create a log file containing the event traces (and possibly System.out.println()'s?) from my servlets. I've read up on the available faq's and other documentation, which directs me to the server.xml file. I've set that file to maximum debugging mode, but still no luck. I get two files in my /log directory: jasper.log and servlet.log. The latter contains nearly nothing, and jasper.log simply reports on my jsp files. Can somebody PLEASE point me in the right direction? If I've missed some important set of documentation please let me know. Thanks! --Ross p.s. - I'm running tomcat 3.2.1 standalone on WinMe, PIII-700, 128mb ram. __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] -- Jason Pell Senior Analyst/Programmer - Web Developer Deakin Software Services Pty Ltd 12 Gheringhap St, Geelong Victoria 3220 Australia Phone: 03 5227 8858 International: +61 3 5227 8858 Fax: 03 5227 8907 International: +61 3 5227 8907 E-mail [EMAIL PROTECTED] http://www.dssonline.com.au Customer Support Hotline: 1800 620 497 "Callista - the brightest solution in university management" --- Important Notice: The contents of this email transmission, including attachments, may be privileged and confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this transmission in error, please advise the sender by return email or telephone immediately and destroy all versions. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] -- Jason Pell Senior Analyst/Programmer - Web Developer Deakin Software Services Pty Ltd 12 Gheringhap St, Geelong Victoria 3220 Australia Phone: 03 5227 8858 International: +61 3 5227 8858 Fax: 03 5227 8907 International: +61 3 5227 8907 E-mail [EMAIL PROTECTED] http://www.dssonline.com.au Customer Support Hotline: 1800 620 497 "Callista - the brightest solution in university management" --- Important Notice: The contents of this email transmiss
RE: log files
Tomcat 4 generates "access logs" of the kind you need Tomcat 3.2 does not. If you are using tomcat 3.2, either use a webserver like apache as a front-end (apache does generate access logs) or upgrade to tomcat 4. For more information, search the email archives, as this question has been asked several times in the recent past. Regards, Simon -Original Message- From: Will Ashley [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, January 02, 2001 7:20 PM To: '[EMAIL PROTECTED]' Subject: log files Hello, I need the ability to have tomcat log information when a user clicks on one of my links to open a PDF file. I need to run a monthly report that tells me the total number of PDFs that were opened and which ones. I looked in the log files that Tomcat is prodocing, but it is not loggin anything when I open a PDF file from a JSP. Will changing the verbosityLevel in the Server.xml file do the trick? Thanks, Will Ashley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]