Retrieving application logs from the cluster management console
Use the cluster management console to configure the system to retrieve application logs that are written on all compute hosts on the grid from one central location. This is not applicable to IBM® Spectrum Symphony Developer Edition.
Goal
You want to configure the system to be able to retrieve application logs that are written on all compute hosts on the grid from one central location, through the cluster management console.
Log location and naming
To retrieve logs through the cluster management console, you must configure the location on which logs are stored on compute hosts.
For our example, we configure the following:
- Services write logs in the following directory structure on compute
hosts:
ConsumerName/ApplicationName/SessionID
- Log files are named according to task ID, for example, sampleService_task1.log, sampleService_task2.log.
- The consumer name is /SampleApplications/SOASamples.
- The application name is sampleApp.
Configuring log location and naming using the command line
- Open your application profile with an XML editor.Note: You can also use the cluster management console to change your application profile to configure parameters to log retrieval.
- In the service section, define the logDirectory, subDirectory and fileNamePattern parameters for each operating system type.
<Consumer applicationName="myApp" ... <Service description="My own service" name="myService" deploymentTimeout="300" packageName="myService"> <osTypes> <osType name="NTX86" startCmd="${SOAM_DEPLOY_DIR}\myService.exe"linebreak pdf logDirectory="${SOAM_HOME}\SampleApplications\SOASamples\myApp" linebreak pdfsubDirectory="%sessionId%" fileNamePattern="_%taskId%"> </osType> <osType name="LINUX86" startCmd="${SOAM_DEPLOY_DIR}/myService" linebreak pdflogDirectory="${SOAM_HOME}/SampleApplications/SOASamples/myApp" linebreak pdfsubDirectory="%sessionId%" fileNamePattern="_%taskId%"> </osType> </osTypes> </Service>
- logDirectory: Directory in which service log files for the application are to be logged. For our example, specify SampleApplications/SOASamples/myApp as the log directory.Important: The path can be any path you want but, the path must be the same on all compute hosts.
- subDirectory: Specify any subdirectory structure within the logging directory. For our example, the subdirectory is according to session ID. Since session IDs change depending on session, use the variable %sessionId%. Other supported variables in this parameter are %taskId%.
- fileNamePattern: Specify how your files are named. The system matches part of the file name. In our example, the file name is sampleservice_taskID.log, so specify: %taskId% and the system matches the file names. Other supported variables in this parameter are %sessionId%.
- logDirectory: Directory in which service log files for the application are to be logged. For our example, specify SampleApplications/SOASamples/myApp as the log directory.
- Save your application profile.
- Reregister your application profile to update your application profile in the system using the soamreg command or the console.
- Run your client application so that the service can create logs in the log directories.
Configuring log location and naming using the console
- Navigate to
A list of applications displays.
. - Select your application from the list.
The application profile editor dialog displays.
- Select Advanced Configuration.
- Click Logging under the Service section to expand the Logging section.
- Specify the Log directory.
For our example, specify SampleApplications/SOASamples/myApp as the log directory.
- Specify the subdirectory naming convention (if used).
For our example, the subdirectory is according to session ID. Since session IDs change depending on session, use the variable %sessionId%. Other supported variables are %taskId%.
- Specify the log file naming convention (if used).
In our example, the file name is sampleservice_taskID.log, so specify: %taskId% and the system matches the file names. Other supported variables are %sessionId%.
- Click Save to save your changes.
Ensuring your service code writes to the configured location
Check your service code and ensure that services for your application write to the configured location and following the file name naming convention.Retrieving application logs with the cluster management console
Downloading logs for an application
- Find the application for which you want to retrieve logs.
Click
. Expand the consumer tree on the navigation, and click the leaf consumer that runs the application.The application list displays with the Actions list.
- Click
The log properties and log retrieval parameters display.
for the application
you want. - Select the logs you want from this host. Click Retrieve
Log List.
A list of logs displays.
- Specify the volume of data:
- Complete log
- Number of lines
- If you selected number of lines, enter the number of lines you
want retrieved.
The number of lines is counted from the latest event back through the log to the limit you specify.
- Click the log file name.
- Save the log file locally and open with any text editor.
Downloading logs for a task
- Click
A list of applications displays.
. - Click the name of the application.
A list of open sessions displays.
- Click the session.
A list of tasks displays.
- Locate the task in the list.
- For that task, select .
- Specify whether you want the log to be compressed or not.
- Click the log file name.
- Save the log file locally, uncompress if necessary, and open with any text editor.
Downloading logs for a service
Binding failures
- Click
A list of applications displays.
. - Click the name of the application.
A list of sessions displays.
- Consult the Binding Failures column for your session.
- Click the SI host name that has logged the session binding failure.
Host Logs page displays.
- Select User specified log or file. Enter the pre-configured log file path.
- Click Retrieve Log List.
A list of log files displays.
- Click the filename with the matching host name and pid of the service instance.
- Save the log file locally, uncompress if necessary, and open with any text editor.
SI startup failures
- Click
A list of applications displays.
. - Consult the SI Startup Failures column for your application.
- Click the SI host name that has logged the SI startup failure.
Host Logs page displays.
- Select User specified log or file. Enter the pre-configured log file path.
- Click Retrieve Log List.
A list of log files displays.
- Click the filename with the matching host name and pid of the service instance.
- Save the log file locally, uncompress if necessary, and open with any text editor.