Hello Wendy,

Set up your <Context ...> entry to look something like this:

<Context path="/myapp" docBase="myapp" debug="5">
    <Logger 
        className="org.apache.catalina.logger.FileLogger"
        prefix="localhost_myapp_servlet_log."
        suffix=".txt"
            timestamp="true" />
</Context>

Setting the debug flag to higher numbers will give you more and more
output...to a point. I just use "5" and it seems to give me all the
info I need.  Either read the docs to find out more specifics about it
or just experiment.

Now, this won't log info for you classes specifically.  It will log
stuff based on what the Tomcat server classes want to log.  If you
want to log on your own, I wouldn't bother with commons-logging.  Use
Log4j directly.  See here for reasons:
http://qos.ch/logging/thinkAgain.html

Jake

Monday, December 09, 2002, 1:45:17 PM, you wrote:


WS> I need help with logging.  I have just today convinced commons-logging and
WS> log4j to work together, and now I would like to do logging from my webapp.

WS> My first question is whether I really need commons-logging and log4j at all.
WS> I see that tomcat is already producing some logs in /path/to/tomcat/logs.
WS> However, I can't figure out how to get one of those for my own webapp.  I
WS> only see logs for admin, examples, and a generic log.  I have read 'The
WS> Logger Component' in the docs, but it doesn't have any info on
WS> configuration.  I don't see any references to logging in server.xml or the
WS> global web.xml or the web.xml in the examples webapp.

WS> If I do use commons-logging+log4j and want to write my own logs to that same
WS> tomcat logs directory, what's the best [cross-platform] way to specify the
WS> location?  I'm currently using:
WS>    log4j.appender.rolling.File=../../../logs/myWebApp.log
WS> which backs up out of WEB-INF/classes and moves down into the logs
WS> directory.

WS> I'm very new at this, so please tell me if I'm going about it all wrong!




-- 
Best regards,
 Jacob                            mailto:[EMAIL PROTECTED]


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

Reply via email to