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.

Note: This feature is only available in IBM Spectrum Symphony, not IBM Spectrum Symphony Developer Edition.

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

  1. 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.
  2. 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%.
  3. Save your application profile.
  4. Reregister your application profile to update your application profile in the system using the soamreg command or the console.
  5. Run your client application so that the service can create logs in the log directories.

Configuring log location and naming using the console

  1. Navigate to Workload > Symphony > Application Profiles.

    A list of applications displays.

  2. Select your application from the list.

    The application profile editor dialog displays.

  3. Select Advanced Configuration.
  4. Click Logging under the Service section to expand the Logging section.
  5. Specify the Log directory.

    For our example, specify SampleApplications/SOASamples/myApp as the log directory.

  6. 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%.

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

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

You can retrieve logs for an application that are created by the session manager of the application.
  1. Find the application for which you want to retrieve logs.

    Click Symphony Workload > Monitor Workload > Applications. Expand the consumer tree on the navigation, and click the leaf consumer that runs the application.

    The application list displays with the Actions list.

  2. Click Actions > Retrieve application system logs for the application you want.

    The log properties and log retrieval parameters display.

  3. Select the logs you want from this host. Click Retrieve Log List.

    A list of logs displays.

  4. Specify the volume of data:
    • Complete log
    • Number of lines
  5. 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.

  6. Click the log file name.
  7. Save the log file locally and open with any text editor.

Downloading logs for a task

You can retrieve the logs for a task that are created by your service application.
  1. Click Symphony Workload > Monitor Workload.

    A list of applications displays.

  2. Click the name of the application.

    A list of open sessions displays.

  3. Click the session.

    A list of tasks displays.

  4. Locate the task in the list.
  5. For that task, select Actions > Retrieve Task Log.
  6. Specify whether you want the log to be compressed or not.
  7. Click the log file name.
  8. Save the log file locally, uncompress if necessary, and open with any text editor.

Downloading logs for a service

Binding failures

You can retrieve the logs for a service in the event of a session binding failure in the service. The SSM lists up to five of the last binding failures.
  1. Click Symphony Workload > Monitor Workload.

    A list of applications displays.

  2. Click the name of the application.

    A list of sessions displays.

  3. Consult the Binding Failures column for your session.
  4. Click the SI host name that has logged the session binding failure.

    Host Logs page displays.

  5. Select User specified log or file. Enter the pre-configured log file path.
  6. Click Retrieve Log List.

    A list of log files displays.

  7. Click the filename with the matching host name and pid of the service instance.
  8. Save the log file locally, uncompress if necessary, and open with any text editor.

SI startup failures

You can retrieve the logs for a service in the event of a service instance startup failure. The SSM lists up to five of the last service startup failures.
Note: If a task fails (where a control code for task failure is set) or a session aborts, the SSM will list the host name and pid of the service instance.
  1. Click Symphony Workload > Monitor Workload.

    A list of applications displays.

  2. Consult the SI Startup Failures column for your application.
  3. Click the SI host name that has logged the SI startup failure.

    Host Logs page displays.

  4. Select User specified log or file. Enter the pre-configured log file path.
  5. Click Retrieve Log List.

    A list of log files displays.

  6. Click the filename with the matching host name and pid of the service instance.
  7. Save the log file locally, uncompress if necessary, and open with any text editor.