tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Servlets & JSPs log to different files
Date Fri, 01 Aug 2003 16:57:30 GMT


>What is standard/recomended approach to getting my servlets and JSPs to
>the same file.
>I am currently using the context logger in server.xml as follows:
><!-- ActionItems Context -->
><Context path="/ai" docBase="ai" debug="0" reloadable="true"
><Logger className="org.apache.catalina.logger.FileLogger"
>suffix=".txt" timestamp="true"/>
>My JSP logs into /var/log/tomcat/ai_log.2003-08-01.txt
>But my servlets log into /var/log/tomcat/catalina.out

How are you logging in your servlets?  Are you using
System.out/System.err?  If so, don't use them, and instead use the
ServletContext#log(..) methods.  Output from the servlet context log
methods will end up in your context logger, ai_log... above.

Alternatively, use a logging kit like log4j and have both your JSPs and
servlets use it.

Yoav Shapira

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.

View raw message