Back to Contents
Installation and Configuration

 


Deployment
The Log4Web component is packaged in a single file called a web archive. This is a standard J2EE package. The file has a .war suffix. The contents of the file can be examined using any zip utility, such as Winzip.

In order to use Log4Web, a web server or application server that supports Java Servlet 2.3 and JSP 1.2 technology is required. For example, Tomcat v4.x is a suitable web server. On the other hand, Tomcat v3.x is not suitable because it supports an earlier version of the Servlet and JSP APIs. On the client side, the web browser must support CSS (Cascading Style Sheets). In practice, this means that Internet Explorer version 4 or later or Netscape Navigator version 4 or later must be used.

The following steps are required in order to deploy Log4Web in a Tomcat 4.x environment.

1) Place the Log4Web.war file in the webapps directory of the Tomcat installation

2) Add the following Context entry in the conf/server.xml in the Tomcat installation:

   <!-- log4Web webapp -->
   <Context path="/log4web" docBase="Log4Web" debug="0" reloadable="true">
   <Logger className="org.apache.catalina.logger.FileLogger"
     prefix="localhost_log4web_log." suffix=".txt"
     timestamp="true"/>
   </Context>
        

3) Start the Tomcat server.

4) The Log4Web component will then be available using a URL such as:

   http://<server_name>:<port>/Log4Web
        

The above procedure represents a very quick guide to deploying Log4Web in a Tomcat 4.x environment. Refer to the web server documentation for more details on the deployment within Tomcat or another web server.


Configuration
The Log4Web.war file can be opened using an application such as Winzip. One of the elements of the package is a file named web.xml. This is the deployment descriptor for the Log4Web archive. This is an ASCII file with an XML syntax. This file is used to set the configuration information for the Log4Web application. It is therefore necessary to edit this file in order to configure it for the target environment.

1) List of message files

   <init-param>
     <param-name>messagesPath</param-name>
     <param-value>file1;file2;dir1;dir2</param-value>
   </init-param>
This parameter value should contain a semicolon-separated list of files and directories. These are the XML log files as generated by Log4J. (Click here for details on configuring Log4J to output XML log files.). Each entry that ends with .log4j is assumed to be a log file. All other entries are assumed to be directories, which Log4Web will search for any files that have a .log4j suffix. When using Log4Web, a list of all log files found on this path will be offered to the user to select from. Log4Web will dynamically refresh its file list by re-reading this parameter after a configurable delay.

2) File list refresh period

   <init-param>
     <param-name>fileListRefreshPeriod</param-name>
     <param-value>10</param-value>
   </init-param>
This parameter gives a delay in seconds between each search of the messages path to look for any new or deleted message files. Click here for more details on how Log4Web caches the message file list for performance reasons. The minimum value for this parameter is 5.

3) Messages refresh period

   <init-param>
     <param-name>messagesRefreshPeriod</param-name>
     <param-value>20</param-value>
   </init-param>
This parameter gives a delay in seconds between reads of each message file to look for new or deleted messages. Click here for more details on how Log4Web caches the messages list for performance reasons. The minimum value for this parameter is 5.

4) Log4J compatibility flag (Log4Web 1.1 and 1.2 only)

   <init-param>
     <param-name>log4jVersion</param-name>
     <param-value>1.1</param-value>
   </init-param>
This parameter indicates which version of Log4J is being used. The value should be set to 1.2.4, 1.2, or 1.1. Log4Web 1.2 will default the value to 1.2.4, while Log4Web 1.1 will use 1.1 as the default value. This flag is important because the XML output format that Log4J uses has been changed several times in the history of the product, so Log4Web needs to know which format it should use. The following table lists the Log4Web versions, the Log4J versions, and their compatibility.

Log4Web Version

Compatible With Log4J Versions

Default Log4J Compatibility

1.0

1.1

1.1

1.1

1.1 to 1.2.3

1.1

1.2

1.1 upwards

1.2.4 upwards

Back to Contents