Yes at some point I do need to switch to log4j. I set the swallowOutput="true"
...
...
<Engine name="Catalina" defaultHost="localhost">
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/mywebapp" docBase="mywebapp" debug="0"
swallowOutput="true"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mywebapp." suffix=".log"
timestamp="true"/>
<Context/>
</Host>
</Engine>
...
...
When i start tomcat now, I still get some of the system.out from my webapp written to catalina.out.
My webapp implements ServletContextListener and HttpSessionListener, the output of the implementation class for ServletContextListener gets written to catalina.out.


Que 1. Is there a way to write this output also to the file I am specifying?

Que 2. Also I notice that when I use FileLogger, it creates a new file each day, is there a way to tell it to create only one big huge file and keep appending to it (like catalina.out) ?

Thanks,

On Oct 26, 2004, at 12:02 PM, Shapira, Yoav wrote:


Hi, Add swallowOutput="true" to your Context element. It also makes the SystemOutLogger/SystemErrLogger definitions redundant IIRC.

Then when you have a chance switch to using a real logging toolkit like
log4j.

Yoav Shapira http://www.yoavshapira.com


-----Original Message-----
From: Mufaddal Khumri [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 26, 2004 3:02 PM
To: Tomcat Users List
Subject: Server.xml configuration question.

Hi,

I am using Tomcat 5.0.27. I want to configure my server.xml such that:
1. all system.outs from my webapp
2. all error and exceptions due to my webapp
get written to logs/mywebapp.log under CATALINA_HOME

This is the except from my server.xml file that I have written:
    ...
    ...
    <Engine name="Catalina" defaultHost="localhost">
      <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">
        <Logger className="org.apache.catalina.logger.FileLogger"
                directory="logs"  prefix="mywebapp." suffix=".log"
               timestamp="true"/>
        <Logger
className="org.apache.catalina.logger.SystemErrLogger"/>
<Logger
className="org.apache.catalina.logger.SystemOutLogger"/>
<Context path="/mywebapp" docBase="mywebapp" debug="0"
reloadable="true" crossContext="true"/>
</Host>
</Engine>
...
...
On running tomcat, I still get all my system.outs and error messages in
catalina.out. How do I
configure my server.xml to get these messages in mywebapp.log ?


Thanks.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




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]


Mufaddal Khumri
Software Developer
Waves In Motion
Phone: 602 956 7080 x 26
Email: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to