From Resin 3.0

Revision as of 23:22, 27 February 2006 by Sam (Talk | contribs)
Jump to: navigation, search


Access logging

Main article: access-log

An access log is a log that receives output describing each request received by the server. It is commonly used in conjunction with analyzing tools to determine statistics and patterns of use for a website.


<access-log path="logs/access.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'

stdout-log and stderr-log

Main article: stdout-log
Main article: stderr-log

The stdout-log and stderr-log directives capture and redirect the output of System.out and System.err.


resin.conf configuration to capture Sysyem.out and System.err output to log files.

<resin xmlns="http://caucho.com/ns/resin"

  <stdout-log path='/var/log/foo/stdout.log'
  <stderr-log path='/var/log/foo/stderr.log'


Main article: log

Java programs (including Resin) can use the logging facilities included in the JDK. Log messages have a name and and a level.

Some Resin logging names have been documented.


Capture finer logging and display it on the console, useful during development:

  <log name="" level="finer" path="stdout:"/>

Rollover directives

Main article: Rollover

Rollover directives indicate that log files should be rolled over to new names at specified frequencies, breaking ever growing log files into manageable chunks.

Archiving directives

Main article: Archiving

archive-format and path-format are two mutually exclusive methods for archiving logs.

path-format specifies the name of a file to write the log to, and the name contains date format escape sequences that are replaced with the current date and time.

<host id="www.foo.com">
   <access-log path-format="/var/www/log/%Y/%m/%d.access.log"

archive-format first writes to a file specified by path, and then copies the file to the archive name at rollover time.

The file specified wth archive-format contains date format escape sequences that are replaced with the current date and time.

archive-format can use a *.gz or *.zip extension to indicate that the archived log should be compressed.

<access-log path="log/access.log"

See also

Redirecting standard output 
Personal tools