Thursday, March 11, 2010

Analyze JVM Logs

ystemOut.log and SystemErr.log files are text files so you can view them using simple text editor.
The Application server writes formatted messages to the SystemOut.log file and this is how a sample log message looks like

[7/2/09 9:12:22:645 PDT] 00000017 ApplicationMg A WSVR0221I: Application started: SchedulerCalendars

Each entry can be deciphered as follows

  • Time Stamp: The first part of the log message in sample code is [7/2/09 9:12:22:645 PDT]. It is the time stamp when the message was written. The time stamp is formatted using the locale of the process and it is 24 hour time stamp with milli-second precision

  • Thread ID: The next part in the log message is 00000017, which represents the thread id. The thread ID is an eight-character hexadecimal value that is generated from the hash code of the thread that issued the message

  • Short name: The short name is the abbreviated name of the component that issued the message. This name is typically the class name of a WAS component and would be some other identifier for the application. In our sample the ApplicationMg is component name

  • Event Type: The event type is a one character field that indicates the type of the message. The possible values are

    • F- Fatal message

    • E- Error message

    • W- Warning message

    • A- Audit message

    • I- Informational message

    • C- Configuration message

    • D- detail message

    • O- Messages that are written directly to System.out by an application or server component

    • R- Messages that are written directly to System.err by the user application or internal component.

    • Z- Place holder to indicate type was not recognized

    In my sample message A indicates this is audit message