Applications such as Apache HTTP Server, IBM WebSphere Application Server, IBM DB2 Universal Database, and IBM HTTP Server can be configured to generate logs in a format that is suitable for parsing with the log parsers.
Here is a list of application configurations that help to format logs so they can be parsed by the parsers that are supplied with the tools.
Note: Log events that are contained in these log files can be analyzed using a symptom database to interpret known events and error conditions. A symptom database is used to find detailed information about error resolution and event significance. For more information on symptom databases and instructions on importing and using them, see the related topics at the end of this file.
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, you must 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)
#----------------------------------------------------------------------------------------------- # Activity Log Properties # # WARNING Before changing any of the Activity Log properties, all servers on the physical # node, including AdminServers must be stopped. # # com.ibm.ws.ras.AcvitityLogEnabled : A property used to determine whether or not the servers on # this node will write Ras events to the activity log or not. Valid values are true and false, # with true the default. Turning off this logging may have serious serviceability impacts. # # com.ibm.ws.ras.ActivityLogSize : Size of the activity log in kilobytes. The default value # is 1024, which yields a log size of 1 megabyte. See the Problem Determination guide for # guidelines on setting the size of this log. #------------------------------------------------------------------------------------------------
com.ibm.ws.ras.ActivityLogEnabled=true
com.ibm.ws.ras.ActivityLogSize=1024
Notes:
com.ibm.ws.http.HttpConnection=entry
Exit=enabled:
com.ibm.ws.webcontainer.srp.ServletRequestProcessor=entry
Exit=enabled,
event=enabled
com.ibm.ws.http.HttpConnection=entry
Exit=enabled:
com.ibm.ws.webcontainer.srp.ServletRequestProcessor=entry
Exit=enabled,
event=enabled
Note: By default, ${LOG_ROOT} is WAS_HOME\logs\ where WAS_HOME is the following:
For V5.0:
com.ibm.ws.http.HttpConnection=entry Exit=enabled: com.ibm.ws.webcontainer.srp.ServletRequestProcessor=entry Exit=enabled, event=enabled
For V6.0:
com.ibm.ws.http.HttpConnection=entry Exit=enabled: com.ibm.ws.webcontainer.srp.ServletRequestProcessor=entry Exit=enabled, event=enabled com.ibm.ws.http.HttpConnection=finer:com.ibm.ws.webcontainer.srp.ServletRequestProcessor=finer
Note: By default, ${SERVER_LOG_ROOT} is WAS_HOME\logs\server_name\ where server_name is the name of the node to which the trace log configuration will be applied and WAS_HOME is the following:
IBM WebSphere Application Server for z/OS can be configured to write error log events to a log stream or to the SYSOUT dataset of the WebSphere Application Server MVS job. Follow the instructions below to copy the error log events to a file that can be parsed and imported into the Log Analyzer. The Log Analyzer can parse and import both V4.0 and V5.0 WebSphere Application Server for z/OS error log files.
Note: IBM WebSphere Application Server for z/OS error log files cannot be imported from MVS datasets. They must be in the UNIX System Services file system
Note: The times in the error log events are parsed as GMT time. You must configure WebSphere Application Server for z/OS to write GMT times in the error log events. That is the default configuration. If it is configured to write local times in the error log events, the timezone information shown in the creationTime property of the log events in the Log View will be incorrect.
ex 'BBO.SBBOEXEC(BBORBLOG)' 'BBO.BOSSXXXX NOFORMAT'
where
oput 'myuserid.BBO.BOSSXXXX' '/waserror.log'
oput 'myuserid.WASERROR.LOG' '/waserror.log'
Note:IBM WebSphere Application Server for z/OS error log files can only be associated by time.
# 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
Notes:
# 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
Notes:
The default configuration of DB2 writes all error and warning messages to a log file called db2diag.log. This file is located in the following location:
For supported Windows environments:
- If the DB2INSTPROF environment variable or keyword is not set, information will be written to X:\sqllib_dir\DB2INSTANCE, where x:\sqllib_dir is the path specified in the DB2PATH registry variable or environment variable, and DB2INSTANCE is the name of the instance owner.
- If the DB2INSTPROF environment variable or keyword is set, information will be written to X:\DB2INSTPROF\DB2INSTANCE, where DB2INSTPROF is the name of the instance profile directory and DB2INSTANCE is the name of the instance owner.
For UNIX-based environments: INSTHOME/sqllib/db2dump, where INSTHOME is the home directory of the instance owner.
The DIAGPATH variable, specified in the database manager configuration, gives the fully qualified path to the first failure data capture (FFDC) storage directory. The default value for DIAGPATH is a null string. To change the DIAGPATH value, use the following command:
DB2 UPDATE DBM CFG USING DIAGPATH path
Follow these steps:
The amount of information being written to the diagnostic log file (db2diag.log) can be configured by following these steps:
The WebSphere Application Server Administrative Console enables you to configure how information related to JDBC is evented. There are two ways to event JCC log messages:
Follow these steps:
Follow these steps:
For JDBC 2 connectivity from the data source, use the setLogWriter() and setTraceLevel() methods on the com.ibm.db2.jcc.DB2SimpleDataSource object. These methods fully enable the default trace level.
You can enable JDBC 1 tracing with the driver manager java.sql.DriverManager.setLogWriter(), or alternatively a traceFile
can be embedded in a JDBC 1 database URL.
For example:
String databaseURL = "jdbc:db2://hal:50000/sample:traceFile=c:/temp/foobar.txt;traceLevel=" +
(com.ibm.db2.jcc.DB2BaseDataSource.TRACE_DRDA_FLOWS | com.ibm.db2.jcc.DB2BaseDataSource.TRACE_CONNECTS) + ";";
For both JDBC 1 and JDBC 2 connectivity, you can turn trace on and off on a connection by using the proprietary method DB2Connection.setJCCLogWriter(java.io.PrintWriter logWriter, int traceLevel). You can also use this method to change the log writer or to adjust the trace level on an active connection. If you use the standard javax.sql.DataSource.setLogWriter(java.io.PrintWriter logWriter)method, the default (fully enabled) trace level is used. You can disable tracing by setting the log writer to null.
For further details on creating trace information for the Universal JDBC driver, refer to the DB2 documentation.
Once you have completed any of the above set of tasks, that particular log file can be imported into your product (File > Import...).
If the TraceFileName keyword was used in the db2cli.ini
file to specify a fully
qualified file name, then the DB2 CLI trace log file will be in the location
specified. If a relative file name was specified for the DB2 CLI trace log file
name, the location of that file will depend on what the operating system
considers to be the current path of the application.
Note:
If the user executing the application does not have sufficient authority to write to the trace log file in the specified path, no file will be generated and no warning or error is given.
If either or both of the TracePathName and JDBCTracePathName keywords were used in the db2cli.ini file to specify fully qualified directories, then the DB2 CLI and DB2 JDBC trace log files will be in the location specified. If a relative directory name was specified for either or both trace directories, the operating system will determine its location based on what it considers to be the current path of the application.
Note:
If the user executing the application does not have sufficient authority to write trace files in the specified path, no file will be generated and no warning or error is given. If the specified trace path does not exist, it will not be created.
The DB2 CLI and DB2 JDBC trace facilities automatically use the application's process ID and thread sequence number to name the trace log files when the TracePathName and JDBCTracePathName keywords have been set. For example, a DB2 CLI trace of an application with three threads might generate the following DB2 CLI trace log files: 100390.0, 100390.1, 100390.2.
Similarly, a DB2 JDBC trace of a Java(TM) application with two threads might generate the following JDBC trace log files: 7960main.trc, 7960Thread-1.trc.
Note: If the trace directory contains both old and new trace log files, file date and time stamp information can be used to locate the most recent trace files.
If no DB2 CLI or DB2 JDBC trace output files appear to have been created:
IBM WebSphere Application Server for iSeries allows multiple server instances each with its own configuration. The subdirectory where the instance is defined will depend on both the version of IBM WebSphere Application Server installed on the server and the server instance name.
For example, if you wanted to see the logging settings on an iSeries machine running IBM 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.
<services xmi:type="loggingservice.ras:RASLoggingService" xmi:id="RASLoggingService_1" enable="true" messageFilterLevel="NONE" enableassociationId="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.
<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.
stopServer -instance default
3. Restart the server
startServer -instance default
Related concepts
Determining problems in distributed
applications using the Log and Trace Analyzer
Autonomic Computing symptom databases
Related tasks
Importing a log file
Importing
and using an AC symptom database
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.