Configures the destination for System.out. Each <host> and <web-app> can have its own individual System.out location. AttributeDescriptionDefault id (or href)Filesystem path for the streamrequired rollover-periodhow often to rollover the log. Normally in days (15D), weeks (2W) or months (1M).none rollover-sizemax 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. AttributeDescriptionDefault id (or href)Filesystem path for the streamrequired rollover-periodhow often to rollover the log. Normally in days (15D), weeks (2W) or months (1M).none rollover-sizemax size of the log before a rollover.1 meg The path 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. AttributeDescriptionDefault idThe access log path.required formatAccess log format.see below rollover-periodhow often to rollover the log. Normally in days (15D), weeks (2W) or months (1M).none rollover-sizemax size of the log before a rollover in bytes.10 meg class-nameClass implementing AbstractAccessLog for custom logging.none init-paramParameters for the custom log.none The access log formatting variables follow the Apache variables: %bresult content length %hremote IP addr %{}irequest header %{}oresponse header %{}ccookie value %nrequest attribute %rrequest URL %sstatus code %{}trequest date with optional time format string. %Ttime of request in seconds %uremote user %Urequest 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. AttributeDescriptionDefault idThe access log path.required rollover-periodhow often to rollover the log. Normally in days (15D), weeks (2W) or months (1M).none rollover-sizemax size of the log before a rollover in bytes.1 meg class-nameClass implementing AbstractAccessLog for custom logging.none init-paramParameters 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. AttributeMeaningdefault idName of debugging sectionnone hrefDestination filenone timestamptimestamp formatnone rollover-counthow many rotated () logs to keep.2 rollover-periodHow 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 valueMeaning /Debug everything /caucho.com/jspDebug jsp /caucho.com/javaJava compilation /caucho.com/xslXSL 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: PatternMeaning %ashort weekday (mon, tue, ...) %Along weekday (Monday, Tuesday, ...) %bshort month (Jan, Feb, ...) %Blong month (January, February, ...) %clocale specific date %dday of month %H24-hour %I12-hour %jday of year %mmonth %Mminute %pam/pm %Sseconds %smilliseconds %Wweek of year %wday of week %y2-digit year %Y4-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 may use path and regular expression variables. VariableValue $server-rootThe root of the server instance. Same as the -server-root argument. $host-rootThe app-dir of the enclosing <host> $app-dirThe app-dir of the enclosing <web-app> $host0 ... $host9Regular expression replacement from a host url-regexp. $app0 ... $app9Regular expression replacement from a web-app url-regexp. $0 ... $9Regular expression replacement for the containing context (host or web-app) $Java property value from System.getProperty("foo")