The best advise I can give you is to use a proper logging API :
Log4J is great :
http://logging.apache.org/log4j/docs/
http://logging.apache.org/log4j/docs/download.html
Just put your log4j.properties file in the classpath of your webapp (WEB-INF/classes),
and log4j will automatically use this configuration.
Note :
1. log4j.appender.FILE.File=C:/log4j.log : this is the file where your log will be.
2. log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender : you should see the same log in
your tomcat window.
Here is an example of log4j.properties :
log4j.rootLogger=DEBUG, CONSOLE, FILE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
# CONSOLE uses PatternLayout.
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
# The conversion pattern uses format specifiers. You might want to
# change the pattern an watch the output format change.
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
# File Appender
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=C:/log4j.log
log4j.appender.FILE.MaxFileSize=10000KB
log4j.appender.FILE.MaxBackupIndex=1
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
-----Message d'origine-----
De : Vamsee Kanakala [mailto:vkanakala@fastmail.fm]
Envoyé : mercredi 28 juillet 2004 14:44
À : Tomcat Users List
Objet : easy debugging
Hello list users,
I'm using Tomcat on win2k. There is a window which is always open
when Tomcat runs. It shows messages like "INFO:" etc. Is there a way I
can write to this window from inside a servlet? I'm just looking for an
easy way to debug my servlets.
TIA,
Vamsee.
--
Because joy is one's fuel - Ayn Rand
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
|