Stdout-log
From Resin 3.0
(Difference between revisions)
(migration) |
(migration) |
||
Line 41: | Line 41: | ||
== Examples == | == Examples == | ||
− | + | [[resin.conf]] configuration to capture all [[System.out]] output to | |
− | + | <tt>log/stdout.log</tt>: | |
+ | <!-- pre --> | ||
<resin xmlns="http://caucho.com/ns/resin" | <resin xmlns="http://caucho.com/ns/resin" | ||
xmlns:resin="http://caucho.com/ns/resin/core"> | xmlns:resin="http://caucho.com/ns/resin/core"> | ||
Line 51: | Line 52: | ||
... | ... | ||
+ | <!-- /pre --> | ||
− | + | [[host]] configuration to capture all [[System.err]] output within a host to | |
− | [[ | + | <tt>log/stdout.log</tt>. Unless a [[web-app]] overrides with it's own <tt>stdout-log</tt>, all web-apps in the host will write to the same output file. |
− | all web-apps in the host will write to the same output file. | + | |
<!-- pre --> | <!-- pre --> | ||
Line 65: | Line 66: | ||
... | ... | ||
<!-- /pre --> | <!-- /pre --> | ||
+ | |||
== See also == | == See also == |
Revision as of 23:02, 27 February 2006
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
- Rollover
- Details about rollover options
- Archiving
- Details about archiving options