Previous Next Up FAQ Table of Contents

5.6 Report and Logfile Formatting

The VolanoChat server uses the text formatting capabilities of Java to allow you to define your own formats for the text, numbers, dates and times in all of the server log files. This section explains how to modify the formats of the following server log files by editing the associated strings in the properties.txt file:

COM.volano.Status module

The format of the status application output can be configured by modifying its Java message format patterns.

format.date
defines the format of the date field.
format.status.memory
defines the format of information about the VolanoChat server's heap memory:
format.status
defines the overall format of the status report messages:
format.status.resources
defines the format regarding Java thread and network connection resources used by the VolanoChat server.

Applet 1: Status report format worksheet.

Server access log

The server access log is formatted from the following message patterns:

format.date
defines the format of the date field.
format.access.agent
defines the format of the information about the client browser's Java environment:
format.access.extra
defines the format of the extra information that can be added to the log entry:
format.access
defines the overall format of the access log entry:

The default access format pattern is assembled as shown below. This format is the NCSA Extended Common Log Format that can be analyzed by any Web log statistical program, such as Analog and Web Trends.

 {0} - - {1} "GET {2} HTTP/{3}" {4,number,0} {5,number,0} "{6}" "{7}" {8}
          ^                                                       ^    ^
          |                                                       |    |
format.date                                     format.access.agent    |
                                                     format.access.extra

The applet worksheet below lets you try out different access log format patterns right on this Web page. The patterns are filled with sample data to give you an idea what a corresponding log entry will look like. Just modify the format fields and press the Enter key.

For example, remove the "z" from the format.date pattern and press the Enter key. You'll see the time zone removed from the formatted date. Change the "MMM" in the date to "mm" and you'll see the date's abbreviated month changed into the month's numeric representation. For a shorter time stamp, try "M/d/y hh:mm:ss a". The other patterns may be modified in a similar fashion.

Applet 2: Server access log format worksheet.

See the section at the end of this page for information about all the possible date, time, and number formatting symbols.

Error log

All potential errors are written to the file defined by the log.error server property. The format of each error is determined by the value of the server.verbose property, which can be set to either true or false. By default server.verbose is set to false. With the verbose error logging disabled, errors are written one per line with a time stamp as a prefix, shown on two lines below:

[Sun May 03 11:45:22 PDT 1998] Error reading from 192.168.0.2.
  (java.net.SocketException: Connection reset by peer)

With the verbose error logging enabled, each error message is followed by the Java stack trace showing where the error originated in the VolanoChat server or Java virtual machine, as shown below:

[Sun May 03 11:45:57 PDT 1998] Error reading from 192.168.0.2.
java.net.SocketException: Connection reset by peer
        at java.net.SocketInputStream.read(Compiled Code)
        at java.io.BufferedInputStream.fill(Compiled Code)
        at java.io.BufferedInputStream.read(Compiled Code)
        at java.io.DataInputStream.readUnsignedShort(Compiled Code)
        at java.io.DataInputStream.readUTF(Compiled Code)
        at COM.volano.net.Connection.read(Compiled Code)
        at COM.volano.net.Connection.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)

Public access log

The public room access log is formatted from the following message patterns:

format.date
defines the format of the date field.
format.public
defines the overall public room access log entry:

The applet worksheet below lets you try out different public room access format patterns right on this Web page.

Applet 3: Public room access log format worksheet.

Private access log

The private room access log is formatted from the following message patterns:

format.date
defines the format of the date field.
format.private
defines the overall private room access log entry:

The applet worksheet below lets you try out different private room access format patterns right on this Web page.

Applet 4: Private room access log format worksheet.

Banned host log

The format of each banned log entry is defined by the following Java format string. The default string below is defined for easy import into the host access control files.

  format.banned={1}\={2,choice,0\#Static|1\#Dynamic|2\#Netblock} \
    address banned at {0} as {4} in {3} by {5}

Where:

Tomcat servlet runner log

The format of this file is determined by Tomcat. More information can be found at Apache's Tomcat logging page.

HTTP server log

The Tomcat servlet runner uses the Common Log Format. A definition of the Common Log Format can be found in Apache's Log Files page.

Velocity engine log

The Velocity engine is not implemented in this version of VolanoChat, and it's logfile is not written to.

Support log

The support.log file is generated once each time the chat server is started, and cannot be reformatted.

Further information

Further information about message formatting patterns can be found in the Internationalization Tutorial chapter of the The Java Tutorial. For a complete list of all the date and time formatting symbols you can use, see the tables under Time Format Syntax and Examples Using the US Locale in the java.text.SimpleDateFormat Java class definition.


Previous Next Up FAQ XHTML 1.0 Table of Contents

2014-07-11 — An updated version of the VOLANO chat server that supports the latest Java 8 Plug-in is now available. More…

The VOLANO® chat software for the Java™ platform lets you build on-line communities and add real-time social networking to your Web site. More…

John Neffenger <john@status6.com>
More…

A PROJECT OF STATUS:6®