| 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:
- {0} the number of kilobytes in use,
- {1} the number of kilobytes available, and
- {2} the percentage of heap memory in use.
format.status- defines the overall format of the status report messages:
- {0} the date and time this status record was taken, formatted by the
format.datepattern above, - {1} the string formatted by the
format.status.memorypattern above, - {2} the string formatted by the
format.status.resourcespattern below, - {3} the number of public chat rooms,
- {4} the number of personal chat rooms,
- {5} the number of private chat sessions,
- {6} the average number of messages received per second during the interval,
- {7} the average number of messages sent per second during the interval, and
- {8} the average total number of messages sent and received per second during the interval.
format.status.resources- defines the format regarding Java thread and network connection resources used by the VolanoChat server.
- {0} the number of active Java threads,
- {1} the number of active connections,
- {2} the number of unique IP addresses connected to the 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:
- {0} the Java vendor,
- {1} the Java version,
- {2} the Java class version,
- {3} the operating system name,
- {4} the operating system version,
- {5} the operating system's hardware architecture, and
- {6} the Java vendor's Web address.
format.access.extra- defines the format of the extra information that can be added to the log entry:
- {0} the duration of the connection, in seconds,
- {1} the host name of the computer where the Web page originated,
- {2} the host name of the computer where the VolanoChat applet originated,
- {3} the number of connections in the server when this connection ended,
- {4} the number of public rooms in the server when this connection ended,
- {5} the number of private rooms in the server when this connection ended, and
- {6} the host name of the computer which closed this connection by kicking or banning the visitor, or
"-"if this connection was not kicked or banned.
format.access- defines the overall format of the access log entry:
- {0} the host name or IP address of the visitor's computer,
- {1} the date and time this connection ended, formatted by the
format.datepattern above, - {2} the URL where the VolanoChat applet originated,
- {3} the version string of the VolanoChat applet,
- {4} the HTTP status code explaining why this connection ended,
- {5} the number of bytes transferred on the chat connection,
- {6} the URL of the referring Web page,
- {7} the string formatted by the
format.access.agentpattern above, and - {8} the string formatted by the
format.access.extrapattern above.
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:
- {0} the date and time the person left the public chat room, formatted by the
format.datepattern above, - {1} the duration of time spent in the public room, in seconds,
- {2} the name of the public room,
- {3} the name of the visitor,
- {4} the host name or IP address of the visitor's computer.
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:
- {0} the date and time the private chat session ended, formatted by the
format.datepattern above, - {1} the duration of the private chat session, in seconds,
- {2} the name of the public room from which this private chat session was created,
- {3} the name of the initiator of this private chat session,
- {4} the host name or IP address of the initiator's computer,
- {5} the name of the responder to this private chat session,
- {6} the host name or IP address of the responder's computer.
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:
- {0} the date and time of banning, formatted by the format.date string
- {1} the IP address of the banned host
- {2} the type of IP address banned. choices are static, dynamic, or netblock
- {3} the room where the banning occured
- {4} the name of the chatter
- {5} the IP address or member monitor name of the person who banned the chatter
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.
| XHTML 1.0 | Table of Contents |