Skip to main content

skip to main content

developerWorks  >  WebSphere  >

Analyzing WebSphere Application Server Logs Using the WebSphere Studio Log Analysis Tool

developerWorks
Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community


Rate this page

Help us improve this content


Level: Intermediate

Ali Manji (amanji@ca.ibm.com), Software Developer, IBM Toronto Lab

05 Aug 2003

This article describes the Log Analysis tool that is provided with IBM ® WebSphere ® Studio V5, and shows you how to use it to diagnose WebSphere Application Server run-time problems.

Introduction

The Log Analysis tool is included with all members of the WebSphere Studio family of products. This article refers to the different WebSphere Studio products as WebSphere Studio and to WebSphere Application Server as Application Server.



Back to top


Diagnosing WebSphere Studio problems

This article focuses on diagnosing Application Server service logs using the Activity Log view in conjunction with a symptom database. A distinction needs to be made between diagnosing and correcting problems in the WebSphere Studio development environment vs. the Application Server run-time environment. You can encounter errors in both environments, and each environment has separate log and trace files, so it's important to examine the log and trace files for the environment where the problems occurred.

WebSphere Studio extends the Eclipse environment by adding plug-ins and features to the existing Eclipse ones. If you encounter a problem using WebSphere Studio, it can be a challenge to determine the originating plug-in. Generally, most plug-ins -- whether they are developed in-house, part of WebSphere Studio, from a third party, or from the core Eclipse project -- will log messages to one of two log files: the .log file or the loggingutil.log , which are both located under the .metadata folder of the workspace directory. To understand how to diagnose these log files, see Finding and Interpreting WebSphere Studio Application Developer Log Files .



Back to top


Diagnosing WebSphere Application Server problems

You may encounter another class of problems when using WebSphere Studio to develop J2EE applications -- problems that doesn't originate from an Eclipse-based plug-in. These problems may arise from using the WebSphere Test Environment (WTE) contained in WebSphere Studio to test, debug, or profile applications. The WTE is a copy of the base WebSphere Application Server -- its main difference compared to the production Application Server is licensing. Therefore, problems encountered in the WTE are no different from those you would encounter in a production Application Server environment. It is best to solve as many run-time errors as possible in the WTE before deploying to a production environment.

There are five types of logs and traces for diagnosing and examining Application Server run-time problems:

  • First Failure Data Capture (FFDC) logs
  • Diagnostic trace
  • Java TM Virtual Machine (JVM) logs
  • Process logs
  • IBM Service logs

The IBM Service log, commonly referred to as the activity log, is the area of focus for this article.



Back to top


WebSphere Application Server Log Analyzer vs. WebSphere Studio Log Analysis Tool

The Application Server Log Analyzer is a standalone, Java-rich client that has shipped with Application Server since Version 4. Beginning with Version 5, WebSphere Studio provides a tool with the same capabilities as the Log Analyzer, but it is integrated within WebSphere Studio, under the Profiling perspective, instead of being a separate client. Both the Application Server Log Analyzer and the WebSphere Studio Log Analysis Tool let you view and analyze the IBM service log, and both tools use a common symptom database to analyze the service log.

The WebSphere Studio Activity Log view and related tools have the advantage over the Application Server Log Analyzer of providing a symptom database editor, which lets you add additional application-specific diagnostic information to symptom databases.

An advantage of the Application Server Log Analyzer is the ability to view diagnostic trace files that Application Server generates. However, the diagnostic trace functionality must be configured to produce its output in a Log Analyzer friendly format; otherwise, the default format is plain text. At this time, WebSphere Studio can't open diagnostic trace files even if the format is set to the Log Analyzer friendly format.

Other than these minor differences between the Log Analyzer and the Log Analysis Tool, both provide the same analytical functionality. The remainder of this article focuses on the WebSphere Studio Log Analysis Tool.



Back to top


The IBM service log

The IBM service log, referred to as the service log, is a binary file. It contains information written to System.out by the Application Server run time as well as special messages that contain extended service information. This extended service information has been useful to IBM WebSphere Service teams in solving complex problems. IBM has now created additional tools to decipher these binary service logs, such as the Log Analyzer in Application Server. However, it is best to solve as many problems as possible during the development phase, before deploying to a production Application Server environment.



Back to top


The symptom database

Viewing the IBM service log through the WebSphere Studio Activity Log view or the Application Server Log Analyzer is not a useful problem analysis activity until the service log is correlated against a richly populated symptom database. IBM WebSphere Service and Support maintains the symptom database. In addition, using WebSphere Studio, you can update the symptom database to add any custom or application-specific diagnostic information yourself. Similar functionality is not available in the Application Server Log Analyzer. The Symptom Database is in XML format and you can download the most recent version .

The symptom database contains three key types of information:

Symptoms
Common problem or error messages
Solutions
Reasons why the error may have occurred
Directives or resolutions
Possible resolutions for the error

Problem messages in the service log are matched against symptoms in the symptom database during analysis. When a match is made, the analytical information in the matching record of the symptom database is made available for problem diagnosis. Figure 1 shows how the Log Analyzer (and by extension, the WebSphere Studio Log Analysis Tool) leverage the various resources described above to diagnose problems:


Figure 1. Analyzing the IBM service log requires a symptom database
Analyzing the IBM service log requires a symptom database


Back to top


The Activity Log view

To view the activity log, from the Servers view of the Server Perspective, select Show Activity Log from the context menu, as shown in Figure 2:


Figure 2. Show Activity Log
Show Activity Log

By default, the service log with the filename activity.log is located in the workspace .metadata directory. The Application Server run time populates it when the WTE is running. However, for organization purposes, the Log Analysis Tool creates a project and imports the service log into it. As shown in Figure 3, you are prompted to choose a project name. The Monitor field in the context of the Log Analysis Tool is used in profiling projects. Accept the default values for both fields. Click Finish .


Figure 3. Importing the service log file
Importing the service log file

In Figure 4 below, the Profiling perspective displays the Activity Log view, which displays the service log records in a visually organized manner. In addition to the Activity Log view, the Profiling Monitor view is visible.

In the Profiling Monitor view, you can see that WAS Activity Log Agent was running under a process called Showlog . Showlog is a program shipped with Application Server and available in the WebSphere Studio WTE. It transforms the service log from binary format to text. The WAS Activity Log Agent uses the transformed text format to render the information into a graphical Activity Log view, as shown below:


Figure 4. Activity Log view
Activity Log view

The Activity Log view has three panes. The first pane, Log Records, shows all records in the service log in sequential order. Select records from the Log Records pane. The other two panes show information about the selected records.

The Information pane has two columns: Property and Value, as shown in Figure 5. High-level information about where and when the log record was created is displayed here, including process id, thread id, component, server, and the product that generated the log record.


Figure 5. Information pane
Information pane

The information pane on the right side of the activity log contains the most valuable diagnostic information. This information helps you determine why the error record or warning record was created, and all known possible remedies. However, regardless of which record is selected in the Log Records pane, the section under the Analysis Result tab will be empty. This section is populated only after the selected records have been analyzed.

Figure 6 shows how to perform the analyze operation for the service log records:

  1. Select the records to be analyzed in the Log Records pane.
  2. Right-click on the selected records and choose Analyze to analyze the selected records or Analyze All to analyze all the records in the service log.

Figure 6. Performing the analysis
Performing the analysis

The error dialog shown in Figure 7 shows that the WebSphere Studio Log Analysis Tool requires a symptom database. The symptom database correlates analysis information against error records and warning records in the service log.


Figure 7. Analysis requires a symptom database
Analysis requires a symptom database

To load the Symptom Database into WebSphere Studio:

  1. Select File => Import => Symptom Database File .
  2. In the Import Symptom Database File window, select the Local host radio button, as shown in FIgure 8 below.
  3. Browse to the symptom database file downloaded locally on the file system.

    To download the symptom database file into the project where the service log is to be analyzed, select Remote host . Selecting this option downloads the latest symptom database onto your system and imports the file into the project. Once imported, the symptom database file, symptomdb.xml , is converted into a format that can be used by the Log Analysis Tool, and the extension of the file is changed to trcdbxmi .

  4. Click Finish .

Figure 8. Importing the symptom database
Importing the symptom database

After importing the symptom database into the project, the log records can be analyzed. Figure 6 above shows how to perform the Analyze and Analyze All operations.

After the Analyze or Analyze All operation is complete, the records in the Log Records pane will be surrounded either by a blue-bordered non-filled box, as shown by Rec_4 in Figure 9, or by a blue-bordered filled box, as shown in Rec_5 . The blue border indicates that no analysis could be performed on the record due to lack of any relevant information in the symptom database. The blue-bordered filled box indicates that information regarding the log record was found in the symptom database.


Figure 9. Record with extended analysis information vs. record with no extended analysis information
Record with extended analysis information vs. record with no extended analysis information

In Figure 10, Rec_77 is half red, indicating that the record is an error. Rec_78 and Rec_79 are partially yellow, indicating that the records are warnings. Rec_80 is half dark blue, indicating that the record contains information of no serious concern.


Figure 10. Differentiating between errors, warnings, and informational records
Differentiating between errors, warnings, and informational records

Selecting an error record containing analysis information in the Log Records pane populates the pane under the Analysis Result tab, as shown in Figure 11. This error is a NameNotFoundException . The reason for this error is described in detail, along with suggested solutions. Of all the information provided, this information is likely to be the most useful in diagnosing and solving run time problems in an Application Server environment.


Figure 11. Examining extended analytical information
Examining extended analytical information


Back to top


Conclusion

This article showed you how to use the WebSphere Studio Log Analysis Tool to view WebSphere Application Server service logs in a visually organized way. In addition, by using the symptom database, you can further analyze the service logs and gain insight into likely solutions for a variety of problems.



Resources



About the author

Ali Manji works with the WebSphere Studio Application Developer Service Team at the IBM Toronto Lab. You can reach Ali at amanji@ca.ibm.com .




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top