NonStop Servlets for JavaServer Pages (5.0) System Administrator's Guide
Logs and Error Conditions
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-002
6-2
Switching From Multiple Log Files to a Single Log
File
log messages to a single log file or to multiple log files. The default logging option is to
use multiple log files. In case of the single log file option, all output is sent to a single
log file (that is, servlet.log).
Example 6-1 shows an example on how to use the <Logger> tag to redirect all the log
messages to a file myApp.<YYYY-MM-DD>.log using time stamped log messages.
The <Logger> tag is used to configure the logging options at the Engine, Host or
Context levels in the NSJSP Container. The <Logger> tag at a subordinate level
overrides the logging configuration specified at a higher level.
For example, a <Logger> tag at the Context level overrides the logging configuration
in effect for the Host or Engine.
In addition, the NSJSP Container uses "Commons Logging" to have a consistent
logging mechanism for all internal components. The "Commons Logging" configuration
is controlled using the commons-logging.properties file in the
$NSJSP_HOME/common/classes/ directory and allows you to specify custom
logging implementations to use. The default NSJSP configuration uses a simple
logging implementation class com.tandem.servlet.logging.NSJSPSimpleLog,
which logs all messages at the "info" level.
The $NSJSP_HOME/common/classes/simplelog.properties file contains the
configuration for the NSJSPSimpleLogger class.
For more information about "Commons Logging" including how to configure and use it,
see the documentation at http://jakarta.apache.org/commons/logging/.
In summary, the <Logger> tag in the iTP_server.xml or the context.xml
configuration files (<context>.xml) along with the "Commons Logging" configuration
controls the logging configuration in the NSJSP Container.
The default logging option uses multiple log files.
Switching From Multiple Log Files to a Single Log File
If you are switching from the multiple log files option (the default) to the single log file
option, perform the following steps:
1. Stop the NSJSP container as described under Stopping NSJSP on page 2-7.
2. Navigate to your /conf subdirectorys:
cd $NSJSP_HOME/conf
Example 6-1. Logger Configuration
<Logger className="com.tandem.servlet.catalina.logger.NSJSPFileLogger"
prefix="myApp." suffix=".log"
timestamp="true" />
<!-- Uncomment this to enable logging to System.out instead of a file.
<Logger className="com.tandem.servlet.catalina.logger.NSJSPSystemLogger" />
-->