r5 - 08 Jul 2008 - 10:45:51 - RandyLetnessYou are here: OSAF >  Documentation Web  >  ServerBundleAdministrator > ServerBundleLogging
Cosmo web server

Server Bundle Logging



The components of the server bundle almost exclusively use Log4j to direct log output. The only exception is Derby, which does not use an external logging provider at all.

Default Configuration

Out of the box, the server bundle writes the following log files:

$OSAFSRV/logs/osafsrv.log
captures debug and error output from the Cosmo and Scooby webapps, the Jackrabbit repository, and Tomcat. Rotated when the file reaches 1000KB in size. One old log will be maintained (with the .1 suffix).

$OSAFSRV/logs/access.YYYY-MM-DD.log
HTTP access log. Rotated at midnight each night. Old logs are not cleaned up.

$OSAFSRV/logs/derby.log
Derby startup notices and errors. Not rotated. It will not grow quickly, usually only containing startup notices. The file is appended to by default; to cause the file to be overwritten when Tomcat restarts, set the environment variable $OSAFSRV_DERBY_ERROR_LOG_APPEND appropriately (see ServerBundleStartupConfiguration for more information).

$OSAFSRV/tomcat/logs/catalina.out
Anything written to STDOUT. This file is not rotated. It will very rarely contain anything. Neither Cosmo nor Scooby uses STDOUT.

Logging to Other Places

Some server administrators prefer to send debug and error log messages to STDERR, STDOUT, syslog, and other locations.

Log4J

Edit $OSAFSRV_HOME/tomcat/common/classes/log4j.xml and configure a different appender.

For example, you can replace osafsrv.log with STDOUT by configuring a ConsoleAppender? as the root appender:

  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">

  ...

  <root>
    <level value="WARN"/>
    <appender-ref ref="CONSOLE"/>
  </root>

Derby

Set the environment variable $OSAFSRV_DERBY_ERROR_LOG to a different filesystem location (see ServerBundleStartupConfiguration for more information). Derby cannot be configured to log to STDOUT.

Un-redirecting STDOUT

There is one other wrinkle regarding STDOUT. Tomcat's startup script redirects STDOUT to $OSAFSRV_HOME/tomcat/logs/catalina.out. You'll have to edit $OSAFSRV_HOME/tomcat/bin/catalina.sh to remove this redirection if you don't want STDOUT captured in that file. Don't worry, this task is simple enough for a blindfolded, no-armed monkey.

Turning Off Access Logging in the Bundled Distribution

In some cases, the server administrator will not need access logging (for example, when the server is run behind a reverse proxy). You can do this by removing the following element from $OSAFSRV_HOME/tomcat/conf/Catalina/server.xml:

  <Valve className="org.apache.catalina.valves.AccessLogValve"
         directory="../logs" prefix="access." suffix=".log"
         pattern="combined" resolveHosts="false"/>

Reference

See ServerBundleStartupConfiguration for more startup configuration options

See http://logging.apache.org/log4j/docs/ for more information about Log4j.

See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/valve.html for more information on Tomcat Access Log Valve configuration.

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.