wood burning stoves
The moose likes Servlets and the fly likes getServletContext().log Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getServletContext().log" Watch "getServletContext().log" New topic


mike zhang
Ranch Hand

Joined: Feb 26, 2002
Posts: 59
when use "getServletContext().log(msg)", how to specify the log file name and location ? can someone give me an example ?
Clark Bruce

Joined: Feb 27, 2002
Posts: 17
log() writes the given message to a servlet log, prepended by the calling servlet's name. The output location (the log) is server-specific, usually an event log file. You will need to search the server directories to find the file name used.
log("I'm writing a message to the log file")
// is an example
Scott Ramsey

Joined: Jun 28, 2001
Posts: 16
What Clark said, except for the fact that using the log() on ServletContext does not prepend the name of a servlet--only the log() on GenericServlet does that.

Scott<br />-----------------<br />SCJP, SCJD, SCWCD<br />XML, UML, WLS6.0
I agree. Here's the link: http://aspose.com/file-tools
subject: getServletContext().log
It's not a secret anymore!