Stdout-log

From Resin 3.0

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

resin.conf configuration to capture all System.out output to log/stdout.log:

<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'/>
 
  ...

host configuration to capture all System.err output within a host to log/stdout.log. 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
Personal tools