RE: Server.xml configuration question.

2004-10-26 Thread Shapira, Yoav

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]



Re: Server.xml configuration question.

2004-10-26 Thread Mufaddal Khumri
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]


RE: Server.xml configuration question.

2004-10-26 Thread Shapira, Yoav

Hi,

When i start tomcat now, I still get some of the system.out from my
webapp written to catalina.out.

No.  That can't be right.  The output you're seeing is coming from
somewhere else, or your configuration is otherwise messed up.

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?

I have the same use-case, and it goes to my Logger.

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) ?

You don't have fine-grained control over the log file rotation.  This is
yet another reason why you shouldn't delay in moving to log4j.

Have I mentioned that the Logger elements are gone altogether in Tomcat
5.5, so this is largely a waste of your time?

Yoav



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]



Re: Server.xml configuration question.

2004-10-26 Thread Mufaddal Khumri
Yes, most definitely I have to use the log4j library.
I just rechecked my server.xml and I am still baffled as to why the 
output is going to catalina.out ?

Heres the entire server.xml:
---START
Server port=8005 shutdown=SHUTDOWN
  Service name=Catalina
Connector port=9090
   maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
   enableLookups=false redirectPort=8443 
acceptCount=100
   debug=0 connectionTimeout=2
   disableUploadTimeout=true /

!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
Connector port=8009
   enableLookups=false redirectPort=8443 debug=0
   protocol=AJP/1.3 /
!-- This is here for compatibility only, not required --
!--Connector port=8009 protocol=AJP/1.3 /--
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=false
Logger className=org.apache.catalina.logger.FileLogger
directory=logs  prefix=mywebapp. 
suffix=.log
timestamp=false/
/Context
  /Host
/Engine
  /Service
/Server
Any Ideas?
---FINISH
On Oct 26, 2004, at 12:35 PM, Shapira, Yoav wrote:
Hi,
When i start tomcat now, I still get some of the system.out from my
webapp written to catalina.out.
No.  That can't be right.  The output you're seeing is coming from
somewhere else, or your configuration is otherwise messed up.
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?
I have the same use-case, and it goes to my Logger.
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) ?
You don't have fine-grained control over the log file rotation.  This 
is
yet another reason why you shouldn't delay in moving to log4j.

Have I mentioned that the Logger elements are gone altogether in Tomcat
5.5, so this is largely a waste of your time?
Yoav

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]


RE: Server.xml configuration question.

2004-10-26 Thread Shapira, Yoav

Hi,

I just rechecked my server.xml and I am still baffled as to why the
output is going to catalina.out ?

Because the Logger is inside your Context, it applies only to that
Context.  It does not apply to other Contexts within your Host, such as
those created by autoDeploy.  Try moving Logger from the Context to
the Host.

Yoav



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]



Re: Server.xml configuration question.

2004-10-26 Thread Mufaddal Khumri
Hi,
No change. Moved it to the host and also moved it under Engine to see 
if that changes anything. Still the same results.

Regards,
On Oct 26, 2004, at 12:54 PM, Shapira, Yoav wrote:
Hi,
I just rechecked my server.xml and I am still baffled as to why the
output is going to catalina.out ?
Because the Logger is inside your Context, it applies only to that
Context.  It does not apply to other Contexts within your Host, such as
those created by autoDeploy.  Try moving Logger from the Context to
the Host.
Yoav

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]