Use the Log and Trace Analyzer with iSeries logs

On the iSeries, there are 4 types of logs which can be imported into the Log and Trace Analyzer:

 

Configuring Apache Server for logging

The Apache configuration file is named /www/apachedft/conf/httpd.conf on the iSeries server. It should have the following directives in order to properly enable the access and error logs:

# ErrorLog: The location of the error log file. If this does not start
# with /, ServerRoot is prepended to it.

ErrorLog ./logs/error.log

# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.

LogLevel warn

# The following directives define some format nicknames for use with
# a CustomLog directive (see below).

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# The location of the access logfile (Common Logfile Format).
# If this does not start with /, ServerRoot is prepended to it.

CustomLog ./logs/access.log common

The two sections in bold text above define where the Apache error log and access logs are located respectively. In this case, for example, with ServerRoot as /www/apachedft, the logs would appear in subdirectory /www/apachedft/logs/ and be respectively named error.log.* and access.log.*. The final suffix on the filename will be date-dependent (e.g. the first error.log.for December 31, 2003 may be named something like Q103123100).

After you have changed the Apache configuration file,  restart the Apache server to reflect this change. From the OS400 command line, enter
STRTCPSVR SERVER(*HTTP) INSTANCE(APACHEDFT)

Conversely, ending the Apache server can be done with the following command in the OS400 command line:
ENDTCPSVR SERVER(*HTTP) INSTANCE(APACHEDFT)

 

Configuring WebSphere Application Server for logging

Because WebSphere Application Server for iSeries allows multiple server instances, each instance will have its own configuration, and therefore the subdirectory where this is defined will depend on both the version of WebSphere installed on the server and the server instance name. For example, if you wanted to see the logging settings on an iSeries machine running WebSphere Application Server Express V5.0 for a server instance named default, the server.xml file would be stored in the following location:

/QIBM/UserData/WebASE/ASE5/default/config/cells/myhostname/nodes/mynodename/servers/server1/server.xml.

This server.xml file contains the specifications for logging. The activity log is turned on by default, in the following clause:

<services xmi:type="loggingservice.ras:RASLoggingService" xmi:id="RASLoggingService_1" enable="true" messageFilterLevel="NONE" enableCorrelationId="true">
<serviceLog xmi:id="ServiceLog_1" name="${LOG_ROOT}/activity.log" size="2" enabled="true"/>
</services>

The activity log (according to the above example) would appear in the file /QIBM/UserData/WebASE/ASE5/default/logs/activity.log.

WebSphere Application Server's trace log is not turned on by default. You may need to edit the server.xml file to turn tracing on by adding the following 3 lines:

<services xmi:type="traceservice:TraceService" xmi:id="TraceService_1" enable="true" startupTraceSpecification="com.ibm.ws.http.HttpConnection=entryExit=enabled:com.ibm.ws.webcontainer.srp.ServletRequestProcessor=entryExit=enabled,event=enabled" traceOutputType="SPECIFIED_FILE" traceFormat="BASIC" memoryBufferSize="8">
<traceLog xmi:id="TraceLog_1" fileName="${SERVER_LOG_ROOT}/trace.log" rolloverSize="20" maxNumberOfBackupFiles="1"/>
</services>

According to the example above, this will create a trace log in file /QIBM/UserData/WebASE/ASE5/default/logs/server1/trace.log.

The affected WebSphere Application Server instance will need to be stopped and restarted for any configuration changes to be made effective. This can be done either from the command line or from the WebSphere Application Server administration console. Stopping the server from command line (e.g. if the server instance name is default), you would issue the following commands to the iSeries QShell interpreter (after changing the current directory to the applicable WebSphere Application Server bin directory, e.g. for WebSphere Application Server Express V5 it would be /QIBM/ProdData/WebASE/ASE5/bin)

stopServer -instance default

And to restart the server, again in QShell, enter

startServer -instance default

Related concepts
Overview of the Log and Trace Analyzer
Common Base Event model
The symptom database

Related tasks
Setting logging preferences

Related reference
Log view