Configures the destination for System.out. Each <host> and
<web-app> can have its own individual System.out location.
Attribute | Description | Default
|
id (or href) | Filesystem path for the stream | required
|
rollover-period | how often to rollover the log. Normally in days (15D), weeks (2W) or months (1M). | none
|
rollover-size | max size of the log before a rollover in bytes. | 1 meg
|
The following example configures System.out for a host. All web-apps in the
host will write to the same output file.
...
<host id='foo.com'>
<stdout-log href='/var/log/foo/stdout.log'
rollover-period='1W'/>
...
</host>
...
|
Configures the destination for System.err. Each <host> and
<web-app> can have its own individual System.err location.
Attribute | Description | Default
|
id (or href) | Filesystem path for the stream | required
|
rollover-period | how often to rollover the log. Normally in days (15D), weeks (2W) or months (1M). | none
|
rollover-size | max size of the log before a rollover. | 1 meg
|
The path href may use path and regular expression variables.
The following example configures System.err for a host.
All web-apps in the host will write to the same output file.
...
<host id='foo.com'>
<stderr-log href='/var/log/foo/stderr.log'
rollover-period='1W'/>
...
</host>
...
|
The access-log configures the logging of each request.
The access-log can be configured either in the <http-server>, <host>,
or <web-app> context. It will apply within the context.
Attribute | Description | Default
|
id | The access log path. | required
|
format | Access log format. | see below
|
rollover-period | how often to rollover the log.
Normally in days (15D), weeks (2W) or months (1M). | none
|
rollover-size | max size of the log before a rollover in bytes. | 10 meg
|
class-name | Class implementing AbstractAccessLog for custom logging. | none
|
init-param | Parameters for the custom log. | none
|
The access log formatting variables follow the Apache variables:
%b | result content length
|
%h | remote IP addr
|
%{xxx}i | request header xxx
|
%{xxx}o | response header xxx
|
%{xxx}c | cookie value xxx
|
%n | request attribute
|
%r | request URL
|
%s | status code
|
%{xxx}t | request date with optional time format string.
|
%T | time of request in seconds
|
%u | remote user
|
%U | request URI
|
The default format is:
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
|
<host id=''>
<access-log id='log/access.log'>
<rollover-period>2W</rollover-period>
</access-log>
...
</host>
|
The class-name attribute allows for custom logging. Application can
extend a custom class from com.caucho.http.log.AbstractAccessLog. The
init-param parameters set bean parameters in the custom class.
...
<host id='foo.com'>
<access-log href='$server-root/foo/error.log'
rollover-period='1W'
class-name='test.MyLog'>
<init-param foo='bar'/>
</access-log>
...
</host>
...
|
The error-log configures the destination for ServletContext.log()
messages. The error-log is also used for exceptions not caught
by the application.
The error-log can be configured either in the <http-server>, <host>,
or <web-app> context. It will apply within the context.
Attribute | Description | Default
|
id | The access log path. | required
|
rollover-period | how often to rollover the log.
Normally in days (15D), weeks (2W) or months (1M). | none
|
rollover-size | max size of the log before a rollover in bytes. | 1 meg
|
class-name | Class implementing AbstractAccessLog for custom logging. | none
|
init-param | Parameters for the custom log. | none
|
The class-name attribute allows for custom logging. Application can
extend a custom class from com.caucho.http.log.AbstractErrorLog. The
init-param parameters set bean parameters in the custom class.
...
<host id='foo.com'>
<error-log href='$server-root/foo/error.log'
rollover-period='1W'
class-name='test.MyErrorLog'>
<init-param foo='bar'/>
</error-log>
...
</host>
...
|
Starts logging for debugging.
Attribute | Meaning | default
|
id | Name of debugging section | none
|
href | Destination file | none
|
timestamp | timestamp format | none
|
rollover-count | how many rotated (href.n) logs to keep. | 2
|
rollover-period | How often to rotate the log. | none
|
For example, to log everything to standard error use:
<caucho.com>
<log id='/' href='stderr:' timestamp="[%H:%M:%S.%s]"/>
...
</caucho.com>
|
log id value | Meaning
|
/ | Debug everything
|
/caucho.com/jsp | Debug jsp
|
/caucho.com/java | Java compilation
|
/caucho.com/xsl | XSL debugging
|
/caucho.com/tcp-server
| TCP connections
|
/caucho.com/thread
| Thread creation and deletion
|
/caucho.com/sql
| Database pooling
|
/caucho.com/http
| HTTP related information
|
/caucho.com/http/session
| HTTP sessions
|
The timestamp can include the following patterns:
Pattern | Meaning
|
%a | short weekday (mon, tue, ...)
|
%A | long weekday (Monday, Tuesday, ...)
|
%b | short month (Jan, Feb, ...)
|
%B | long month (January, February, ...)
|
%c | locale specific date
|
%d | day of month
|
%H | 24-hour
|
%I | 12-hour
|
%j | day of year
|
%m | month
|
%M | minute
|
%p | am/pm
|
%S | seconds
|
%s | milliseconds
|
%W | week of year
|
%w | day of week
|
%y | 2-digit year
|
%Y | 4-digit year
|
Debugging uses the com.caucho.vfs.LogStream interface. A typical use is
as follows
import com.caucho.vfs.*;
public class Foo {
static WriteStream dbg = LogStream.open("/caucho.com/foo");
...
void doFoo()
{
if (dbg.canWrite())
dbg.log("executing foo");
}
...
}
|
The path href may use path and regular expression variables.
Variable | Value
|
$server-root | The root of the server instance. Same as the -server-root argument.
|
$host-root | The app-dir of the enclosing <host>
|
$app-dir | The app-dir of the enclosing <web-app>
|
$host0 ... $host9 | Regular expression replacement from a host url-regexp.
|
$app0 ... $app9 | Regular expression replacement from a web-app url-regexp.
|
$0 ... $9 | Regular expression replacement for the containing context (host or web-app)
|
$foo | Java property value from System.getProperty("foo")
|
Copyright © 1998-2002 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark,
and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc. | |
|