Stdout-log

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(migration)
 
(migration)
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
[[Category:Directives]]
 +
 
Capture output sent to [[System.out]].
 
Capture output sent to [[System.out]].
  
 
{|
 
{|
||directive||meaning||default
+
!directive||meaning||default
 
|-
 
|-
 
||[[path]]
 
||[[path]]
Line 41: Line 43:
 
== Examples ==
 
== Examples ==
  
Capture all server output to <tt>log/stdout.log</tt> with [[resin.conf]]
+
[[resin.conf]] configuration to capture all [[System.out]] output to
configuration:
+
<tt>log/stdout.log</tt>:
  
 +
<!-- pre -->
 
  &lt;resin xmlns="http://caucho.com/ns/resin"
 
  &lt;resin xmlns="http://caucho.com/ns/resin"
 
         xmlns:resin="http://caucho.com/ns/resin/core"&gt;
 
         xmlns:resin="http://caucho.com/ns/resin/core"&gt;
Line 51: Line 54:
 
    
 
    
 
   ...
 
   ...
 +
<!-- /pre -->
  
The following example configures [[System.out]] for a
+
[[host]] configuration to capture all [[System.err]] output within a host to
[[host]].  Unless a [[web-app]] overrides with it's own <tt>stdout-log</tt>,
+
<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 68:
 
  ...
 
  ...
 
<!-- /pre -->
 
<!-- /pre -->
 +
  
 
== See also ==
 
== See also ==
Line 70: Line 74:
 
; [[stderr-log]] : Capture output sent to [[System.err]]
 
; [[stderr-log]] : Capture output sent to [[System.err]]
 
; [[Logging]] : A general overview of logging facilities in Resin
 
; [[Logging]] : A general overview of logging facilities in Resin
; [[Rollover]] : Details about rollover options
 
; [[Archiving]] : Details about archiving options
 

Latest revision as of 17:49, 28 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

[edit] 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.

[edit] 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>
...


[edit] See also

stderr-log 
Capture output sent to System.err
Logging 
A general overview of logging facilities in Resin
Personal tools