Showing posts with label configureandreviewlogs. Show all posts
Showing posts with label configureandreviewlogs. Show all posts

Process (native) logs

The process logs are created by redirecting the STDOUT and STDERR streams of the process to independent log files. Native code, including the Java virtual machine (JVM) itself, writes to these files. As a general rule, WebSphere Application Server does not write to these files. However, these logs can contain information relating to problems in native code or diagnostic information written by the JVM.

As with JVM logs, there is a set of process logs for each application server, since each JVM is an operating system process. For WebSphere Application Server Network Deployment configuration, a set of process logs is created for the deployment manager and each node agent.

The only configuration that is possible for the process logs is changing the directory location or file names for the logs. You can do this in the WAS Admin console by going to Troubleshooting -< Logs and Traces and clicking on process name. On the Logging and Tracing screen select Process Logs



Then on the Process Logs screen you can change the location of native_stdout.log or native_stderr.log file.



You can view the native_stderr.log and native_stdout.log file either using any text editor or you can view it using the WAS Admin Console (even for remote location) by going to the Runtime tab. Select the log file that you want to see

View JVM Logs using Log Analyzer

You can view JVM Logs in Log Analyzer tool, which is part of WebSphere Application Server Toolkit. The Log analyzer will format and display the log in easy to read format.


  • Start the WebSphere Application Server Toolkit. And once it is started switch to Logging and Performance perspective.

  • Right in the Log Navigator perspective and click on Import. In the Import dialog select Profiling and Logging -< Log Files


  • Click Next, on the next Import Log Files dialog click on Add button to get Add Log File dialog like this


  • On this dialog select type of log as IBM -< WebSphere Application Server -< IBM WebSphere Application Server System Out. In the details section select location of the SystemOut.log file as well as the rules that you want to apply

  • The Log analyzer tool will take couple of minutes to parse the log file and finally it will show a screen like this. As you can see it marked the error messages in red and warning messages in yellow


  • You can get more information about each of the message by right clicking on message and executing Analyze -> Run. It will take the message identifier for the message and try and find more information in the Symptomps database. And display that information about detail message, possible recommendation,.. on the next screen.



View JVM Logs using WAS Admin Console

If you dont have access to the file system of where server is installed Ex. you want to view SystemOut.logs for WAS on remote system, then you can use WAS Admin Console. Go to the Runtime tab for JVM Logs and you will get screen like this



On this screen select the log that you want to view by clicking on the View button and it would display the JVM log on next screen like this.

Analyze JVM Logs

SystemOut.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

  • Message identifier: The message identifier is a string that is nine characters in length and is in the form CCCC1234X. THe first four characters indicate the WAS component that issues the message. The next four characters indicate the specific message that component is issuing. The last character indicates the severity of the message. Its value is either I- informational, W- Warning or E error. You can find description of all identifiers in the WAS Information center. If your looking at the message in the Rational Application developer console, then each of these message identifier would be displayed as link. Clicking on the link would give details for the message identifier like this.


    If not you can get similar details about the message identifier by using Log Analyzer.



  • Message: The message is the data that is logged to the SystemOut.log by the component

Configuring JVM Logs

You can configure the JVM logs using WAS Admin Console. Follow these steps in order to do that

  • Log into the WAS Admin Console

  • Go to TroubleShooting -< Logs and Trace. Select the server/process whose log you want to configure and you will get a screen like this


  • Click on JVM Logs to get the JVM Logs Configuration Screen like this


    You can configure following parameters on this tab

    • File Name: The name of a file in the file system. It is recommended that you use a fully qualified file name. If the file name is not fully qualified, it is considered to be relative to the current working directory for the server. Each stream must be configured with a dedicated file. For example, you cannot redirect both System.out and System.err to the same physical file.

    • File formatting: Specifies the format to use in saving the System.out file. It is recommended to use the default value of basic format

    • Log file rotation: The SystemOut and SystemErr logs are self-managing. They write to the specified file until either the maximum file size or certain time is reached. When that happens the current log file renamed as the current file name plus the current time stamp. Then a new SystemOut and SystemErr file is created for further logging. The older log files are called historical log files.
      Depending on your needs you can choose to have the log file rotate when they reach a specified size(Say 5 MB) or certain time(Every morning) or both.

    • Maximum Number of Historical Log Files. Number in range 1 through 200. The value that is entered here is the number of historical log files that are kept. If the value is reached and another historical log file needs to be created, the oldest one is removed from your system.

    • Installed application output: These properties affect how print and println statement from your application are output. There are two options

      • Show application print statements: This is enabled by default. If you de select it, application print and println statements are not logged to the SystemOut and SystemErr log file

      • Format Print Statement: This is also enabled by default. You can deselect it if you do not want your application print and println statement to be formatted similar to the WAS messages in the log





What is JVM Logs

The WAS application server redirects content System.out stream to SystemOut.log and System.err stream to SystemErr.log. The SystemOut.log and SystemErr.log are also known as JVM logs. The WebSphere Application Server writes to this log and you can write into this log from your application by using println(), printStackTrace() calls

These logs are created for every WebSphere Application Server process, such as deployment manager, node agent, nodes,.. You can find these logs in profiles/<profilename>/logs/<processname> folder.