"Wendy Smoak" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jacob wrote: > > 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> > > Wow, nothing like it being right there in front of my face. The context tag > for the examples does have a Logger tag-- I must have been searching for > 'Logging' instead. > > Thanks! > > Dan wrote: > > Use Tomcat log interface will make your code depending > > on Tomcat appserver. What if you want run your app > > on other servers in the future? > > I take it logging isn't in the servlet spec? From another message, I got > the impression that the container would want to send some messages itself. > If there is no Logger configured for the webapp, does it just send them to > the console?
There is a 'log' method (serveral, actually) in the ServletContext object. There are also conveniance 'log' methods in GenericServlet (which most servlets extend, since HttpServlet does). This works fine if all you want to do is to log from your servlets. If you also want to be able to log from your Beans as well, it's not much help, since they usually won't have access to the ServletContext. In this case you are better off with commons-logging and/or log4j. > > -- > Wendy Smoak > Applications Systems Analyst, Sr. > Arizona State University PA Information Resources Management > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
