This is a Java servlet lets you analyze the log file for your web-server. You can use this servlet as a simple analytical tool for reviewing visitors for your site. How to use it: a) copy weblogPackage.jar into WEB-INF/lib b) describe WebLog servlet in web.xml file. As an initial
parameter for this servlet you must set a path to configuration file
describes log file format. Usually it must be pretty standard (so
called NCSA log format). Parameter name is config.
<servlet> <servlet-name>WebLog</servlet-name> <servlet-class>com.jsos.weblog.WebLog</servlet-class> <init-param> <param-name>config</param-name> <param-value>path_to_your_configuration_file</param-value> </init-param> </servlet> c) define a mapping:
<servlet-mapping> <servlet-name>WebLog</servlet-name> <url-pattern>/servlet/WebLog</url-pattern> </servlet-mapping> Now the usage is:
http://your_host/servlet/WebLog?data_file E.g. for our development environment (Orion server) it looks so:
http://your_host/servlet/WebLog?../log/default-web-access.log Here data_file is a full path to the log file for your web server (or copy of that file you are going to analyze). See the manual for your web server for getting the location for log files. Configuration file is a text file, each line has got a form:
You must describe record's structure as a sequence of integer numbers.
Each number from this sequence describes one semantic element from the
following list:
E.g. the following typical line 205.242.228.7 - - [04/Jan/2000:00:06:47 -0800] "GET / HTTP/1.0" 200 3294 "http://javaboutique.internet.com/ChatServlet/" Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)" can be described as:
this line contains:
Notes:
Each line in the configuration file describes one of the above mentioned
parameters. Description has got the following form:
# Record format
# Field delimiter:
# date format
For downloading: weblogPackage.jar Sample of config file: weblog
© Coldbeans Software Comments? See also JSOS - the largest collection of servlets and filters.
|
Also in JSOS:
|