The server tracks its activity using two log files. The transfer
log keeps track of all incoming requests, while the server
log stores server and servlet status messages.
The server log is utilized from your own servlets via its
ServletContext object. Please consult the servlet
documentation for more details. Additionally, the
LogViewer example servlet
demonstrates how to read the log files from within a servlet.
Transfer Log Format
The transfer log is stored in the Extended Common Log Format.
Each line of the log contains the following information:
Address of the client that made the request. For
performance reasons, the server does not look up the host
name. |
The remote login name of the user. This will be a single "-". |
This will be the name that the user used to authenticate
himself, if requesting a protected page. |
The date and time of the request. |
The exact request line from the client. |
This will be the HTTP status code sent by the server |
The number of bytes sent to the client. |
The URL the client was viewing before making the current
request. (Note that the spelling of "referer" is an
unfortunate mistake in the HTTP specification.) |
The user agent the client claims to be using. |
There will be a "-" in each entry that is not known, or cannot be
determined, by the server.
Here is an example of an entry in the transfer log (note
that the line may be wrapped, but should be on one line):
192.168.1.12 - test [Fri Oct 10 10:46:06 CST 2003] "GET /servlet/AuthExample HTTP/1.1" 200 - "http://tini.qindesign.com/" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5"
http://www.bacuslabs.com/WsvlCLF.html
has another description of this format.
Server Log
Each line of the server log will contain a date and a message. Some
messages may include exception stack traces, while some will just
contain descriptive text. For example (note that some
lines may be wrapped, but should be on one line):
[Wed Aug 27 10:40:38 CST 2003]SendMail: init
[Wed Aug 27 10:40:41 CST 2003]ServletException(Error while sending mail: Unexpected reply: 501 5.1.8 Domain of sender address kgjfhdkh@fdhgfhddfhgf.com does not exist) with request path '/servlet/SendMail'
[Tue Sep 16 22:22:37 CST 2003]Transfer log mailed to some@address.net?from=another@address.com
[Wed Sep 17 03:24:15 CST 2003]java.io.IOException
No other stack trace info available.
Log Configuration
The log files are configured using the
logging properties in the
server properties file. It is possible to
configure the log file locations, their maximum size, and where they
will get emailed when full.
|