Stdout-log

From Resin 3.0

Revision as of 22:47, 27 February 2006 by Sam (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Capture output sent to System.out.

directive meaning default
path output path for the stream either path-format or path is required
path-format the name of a file to write the log to, date format escape sequences are replaced with the current date and time either path or path-format is required
timestamp a timestamp in date format to use at the beginning of each log line. no timestamp
rollover-period how often to rollover the log. Specify a period in days (15D), weeks (2W), months (1M), or hours (1h) none
rollover-size maximum size of the file before a rollover occurs. Specify a size in bytes (50000), kb (128kb), or megabytes (10mb) 1mb
archive-format the format for the archive filename when a rollover occurs path + ".%Y%m%d" or path + ".%Y%m%d.%H" if rollover-period < 1 day

Environments

stdout-log can appear in any environment (i.e. within a server, host, or web-app).

Usage of the stdout-log overrides a previous usage in a containing environment. For example, specifying stdout-log as a child of a web-app causes a redirection of System.out for that web application only, and will override the System.out location in the enclosing host.

Examples

Capture all server output to log/stdout.log with resin.conf configuration:

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

  <stdout-log path='/var/log/foo/stdout.log'
              rollover-period='1W'/>
 
  ...

The following example configures System.out for a host. Unless a web-app overrides with it's own stdout-log, all web-apps in the host will write to the same output file.

...
<host id='foo.com'>
  <stdout-log path='/var/log/foo/stdout.log'
              rollover-period='1W'/>
  ...
</host>
...

See also

stderr-log 
Capture output sent to System.err
Logging 
A general overview of logging facilities in Resin
Rollover 
Details about rollover options
Archiving 
Details about archiving options
Personal tools