Showing posts with label servicelogs. Show all posts
Showing posts with label servicelogs. Show all posts

showlog command

Service logs are logs written in a binary format. You cannot view a service log directly using a text editor. You should never directly edit the service log, as doing so will corrupt the log.

The WebSphere Application Server provides two tools that you can use to work with the service log

  • Log Analyzer: This is GUI tool that is part of WebSphere Application Server toolkit

  • showlog: This is command line tool that is shipped with WebSphere Application server



You can find the showlog tool inside the WebSphere/AppServer/bin folder. If you execute it without arguments it will print out help for that tool

c:\WebSphere\AppServer\bin>showlog.bat
This program dumps a Websphere binary log file to standard out or a file.
Usage: showlog [-format CBE-XML-1.0.1] binaryFilename [outputFilename]
where:
-format specifies the output format. Currently only CBE-XML-1.0.1 forma
t is supported (this complies with the Common Base Event specification version 1
.0.1). If no format is given, showlog outputs in a tabular format.

binaryFilename should be a binary log filename in the WASHOME/logs direc
tory or a fully-qualified binary log filename. showlog will not look in the cur
rent directory.

outputFilename is optional. If no filename is given, showlog dumps bina
ryFilename to standard out. Otherwise, outputFilename will be created in the cu
rrent directory unless it is a fully-qualified filename.


You can execute the showlog tool by using this command

C:\WebSphere\AppServer\profiles\AppSrv01\bin>showlog.bat c:\WebSphere\
AppServer\profiles\AppSrv01\logs\activity.log c:\temp\activity.log


Wait for this command to finish execution then you can open the c:\temp\activity.log in text editor to look at the activity log. This is sample activity.log from my machine.


ExtendedMessage:
---------------------------------------------------------------
ComponentId: Application Server
ProcessId: 5492
ThreadId: 00000025
ThreadName: Non-deferrable Alarm : 5
SourceId: com.ibm.ws.Transaction.JTA.FailureScopeController
ClassName:
MethodName:
Manufacturer: IBM
Product: WebSphere
Version: Platform 6.1 [BASE 6.1.0.0 b0620.14]
ServerName: sunpatil-wxp02Node01Cell\sunpatil-wxp02Node01\server1
TimeStamp: 2009-06-29 12:47:44.836000000
UnitOfWork:
Severity: 3
Category: AUDIT
PrimaryMessage: WTRN0105I: The transaction service has shutdown successfully with no transactions requiring recovery.
ExtendedMessage:
---------------------------------------------------------------
ComponentId: Application Server
ProcessId: 5492
ThreadId: 00000025
ThreadName: Non-deferrable Alarm : 5
SourceId: com.ibm.ws.runtime.component.ServerCollaborator
ClassName:
MethodName:
Manufacturer: IBM
Product: WebSphere
Version: Platform 6.1 [BASE 6.1.0.0 b0620.14]
ServerName: sunpatil-wxp02Node01Cell\sunpatil-wxp02Node01\server1
TimeStamp: 2009-06-29 12:47:45.086000000
UnitOfWork:
Severity: 3
Category: AUDIT
PrimaryMessage: WSVR0024I: Server server1 stopped
ExtendedMessage:

796 records found and printed.

IBM Service log

The IBM Service log contains both the applications erver messages that are written to System.out stream and special messages that contain extended service information that can be used to analyze the problem. The IBM Service log is maintained in a binary format, so in order to view the activity.log file you will have to use either the command line based showlog tool that is shipped with WebSphere Application Server or use GUI based Log Analyzer tool that is shipped with WebSphere Application Server Toolkit.

One service log exists for all Java virtual machines (JVMs) on a node, including all application servers and their node agent, if present. A separate activity log is created for a deployment manager in its own logs directory.The activity log, by default, is a file named activity.log in the profile_home/logs directory. You can edit the settings for the activity log by selecting Troubleshooting > Logs and Trace > server_name > IBM Service Logs in the administrative console.



These are the settings that should be configured:

  • Enable service log: If selected, enables the service log.

  • File Name: Specifies the name of the service log.

  • Maximum File Size: Specifies the number of megabytes to which the file can grow. When the file reaches this size, it begins replacing the oldest data with the newest data

  • Enable Correlation ID: Specifies whether or not a correlation ID should be generated and included in message events.