File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes about  log() of  GenericServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "about  log() of  GenericServlet" Watch "about  log() of  GenericServlet" New topic

about log() of GenericServlet

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

HI All,

log() method is used for(i read it)
log(java.lang.String msg)
Writes the specified message to a servlet log file, prepended by the servlet's name.

but i want to know how to use this and where can i see these log,if i put something into this from some servlet..

please anyone can explain me ?
Steve Luke

Joined: Jan 28, 2003
Posts: 4181

You can use it by calling log("Message to Log") in any of your servlets that extend Generic Servlet.

Where are the logs? How do you configure them? That is server dependent. For Tomcat it is usually <Tomcat_Home>/logs, but other applications will store them elsewhere, and this can usually be configured (again in a server-dependent and for Tomcat version dependent manner). So the best thing to do is read your Server's manual about how it handles logging.

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

THANKS steve
I agree. Here's the link:
subject: about log() of GenericServlet
It's not a secret anymore!