> From: Prashant Rajput [mailto:praj...@infocepts.com] 
> Subject: writing logs on a separate server while the project as jar file

> I am deploying my Java application on tibco server and 
> this server has its own log configuration. When I try to
> write log on this server I have to write separate line
> of code into each java class I am having.

> So can anybody tell me what exactly is the best way to
> write logs to a different server log file, when your
> application will only goes in as a jar file over there.
> My team is not deploying it onthat server we are just
> providing the JAR file having logger statements.

First off, if you're only supplying a .jar file, you're not delivering a 
complete webapp, but rather just some (perhaps all) of the classes of the 
webapp.  A webapp consists of more than just classes; consult the servlet spec 
for the additional spec-defined items such as WEB-INF/web.xml.  Also, a 
complete webapp contains a WEB-INF/classes directory, where items such as 
logging configuration files may be placed.

Second, I hope you're using an actual logging facility (such as log4j), not 
just blindly dumping things to System.out or System.err.  All proper logging 
facilities provide for some means of configuring the level of the detail and 
the output location; whoever is creating the full webapp (of which your .jar is 
just a portion) has the responsibility of setting up the logging configuration 
appropriate for the installation.

If you have been lazy and used System.out or System.err for logging, the person 
configuring the complete webapp can set swallowOutput="true" in the <Context> 
element for the webapp.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to