Greetings!

After many days of searching and so on, I am still looking for information
on using the default logging built into Tomcat.

I am running Tomcat 3.2.1 under apache 1.3.12 on Solaris 2.7, with Java
1.3.

I have a servlet application set up that catches all the 'expected' errors
and logs them to text files, databases, etc.  This includes bad input,
missing or wrong parameters, and so on.

However, I still need to catch 'unexpected' errors at the top level and
log them to a standard log file.  Currently, I just am doing this:

} catch (Exception e) {
        e.printStacktrace();
}

This is fine for development; at least I can see on the console what
happened.  However, for production rollout, I'd sure like to be able to
have some real logs.

I have checked google, groups.google and the mailing list.  I do not want
to simply do a `tomcat start  >&2&1` log, I want actual java interfaces to
a logger object that can write to the log listed in server.xml.

My server.xml file currently has a log listed:

--- server.xml excerpt ---
    <Logger name="tc_log" 
            path="logs/tomcat.log"
            customOutput="yes" 
            verbosityLevel="ERROR"/>
--- server.xml excerpt ---

However, this isn't working yet.

Also, in the <ContextManager> section of server.xml for my servlet, I see
this line:

<!-- ContextInterceptor className="org.apache.tomcat.context.LogEvents" /
-->

As you can see, it is commented out.  I have not found any references to
this in the FAQ or docs; of course it is entirely possible I have
overlooked this.  Uncommenting this did not change anything.

I have also tried to import org.apache.tomcat.logging.* into my servlet to
create a logger or TomcatLogger class, but the "package
org.apache.tomcat.logging does not exist".


SO, in a nutshell,  how do I get access to a logger object to log errors
and exceptions to the log referenced in the server.xml file?

Thanks in advance for any tips, pointers etc.

Will



-- 
  "If Al Gore invented the Internet, then I invented spellcheck!"
      Dan Quayle, quoted at the National Press Club, 8/3/1999 
                          [EMAIL PROTECTED] 
  Recovery  : http://will.mylanders.com/         PCS:  316-371-FOAD 

Reply via email to