Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: no contexts, several webapps, autoDeploy, differentloggers?

Shapira, Yoav

2004-01-15

Replies:


Howdy,
There is no magic token for the app name in the DefaultContext element.
So you need a Logger for each Context explicitly defined. The Logger
for a Context handles all servlets for that context. If you have one
logger in your DefaultContext and no other Contexts defined, all output
from all your contexts will go to this one logger.

The above applies to tomcat 4 and 5.

I would not go down this route at all: instead, use a real logging
system like log4j.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Howard Watson [mailto:howardw@(protected)]
>Sent: Thursday, January 15, 2004 2:45 AM
>To: tomcat-user@(protected)
>Subject: Re: no contexts, several webapps, autoDeploy,
differentloggers?
>
>In order to have a seperate log file for each web app you will need a
>logger for each context.
>
>Tomcat3 had ContextXmlReader that would allow you put context
>configuration for each webapp in its own file. It also had LogSetter
>name=servlet_log that you could define in <ContextManager> and log all
>your servlets to the same file. Not sure what replace these in tc4 & 5.
>
>Did you try using Logger inside <DefaultContext>? I would expect it
>write all your app logs to one file, but don't know for sure.
>
>http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/defaultcontext.h
tml
>http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/logger.html
>
>Hope others have better answers. I'd like to know more too.
>Howard
>>>> apu@(protected) >>>
>
>i have a server.xml configured with the following Host element:
>
>    <Logger className="org.apache.catalina.logger.FileLogger"
>         prefix="catalina_log." suffix=".txt"
>         timestamp="true"/>
>
>    <Host name="192.168.100.152" debug="0" appBase="webapps"
>     unpackWARs="true" autoDeploy="true"
>     xmlValidation="false" xmlNamespaceAware="false">
>
>     <Context path="/manager" debug="0" privileged="true"
>           docBase="/usr/local/tomcat5/server/webapps/manager">
>       <Realm className="org.apache.catalina.realm.MemoryRealm" />
>     </Context>
>
>     <Context path="/admin" debug="0" privileged="true"
>           docBase="/usr/local/tomcat5/server/webapps/admin">
>       <Realm className="org.apache.catalina.realm.MemoryRealm" />
>     </Context>
>    </Host>
>
>when tomcat starts up, it deploys all the webapps found in appBase. it
>uses the global logger defined catalina_log.xxx.txt...
>
>is it possible, using the DefaultContext or otherwise to have
individual
>loggers for each auto-deployed *without* adding a
>
><Context path="webapp1">
> <Logger prefix="webapp1." suffix=".log" />
></Context>
>
>in server.xml? is there something like
>
><DefaultContext>
> <Logger prefix="$auto-deploy-webapp" suffix=".log" />
></DefaultContext>
>
>or conceptually similiar way to achieve this result? i do not want to
>add the individual <Context> entries into server.xml....
>
>thanks in advance for any pointers.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
>For additional commands, e-mail: tomcat-user-help@(protected)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
>For additional commands, e-mail: tomcat-user-help@(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: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.