SAS 9.1.3 Integration Technologies » Administrator's Guide


SAS Foundation Services
Understanding
Service Deployments
Service Deployment Configuration
Managing Service Deployments
Defining
Importing
Exporting
Duplicating
Redistributing
Installing and Running Foundation Services as a Windows Service
Understanding How Applications
Deploy Foundation Services
Locate Services
Scenario: Stand-alone application
Scenario: Remote-accessible Services
Scenario: Local and Remote-accessible Services
Share Foundation Services
Modifying Service Configurations
Event Broker Service
Events and Process Flows
Modifying the Configuration
Creating Events and Process Flows
Information Service
Logging Service
Pattern Layouts
Session and User Service
Monitoring Applications
Foundation Services

Modifying the Logging Service Configuration

The Logging Service enables applications to:

  • send runtime messages to one or more output destinations, including consoles, files, and socket connections.
  • configure and control the format of information sent to a particular destination. Configuration can be performed through static configuration files or by invoking runtime methods that control logging output.
  • perform remote logging, which involves sending log messages generated in one Java virtual machine (JVM) to another JVM.
  • perform logging either by user session or by JVM.

For more information about the Logging Service, see com.sas.services.logging in the Foundation Services class documentation.

When a service deployment is defined and deployed, a base logging configuration is used to determine the appropriate output destinations. However, you can use SAS Management Console Foundation Services Manager to modify the Logging Service configuration and configure additional logging contexts and output destinations. The Logging Service configuration consists of the following items:

  • Contexts: the logging context definition specifies the name and outputs for a specific logging context. In your application, you code the Logging Service to send information to a specific logging context. (The RootLoggingContext is used for any logging context that is not configured.)

    When naming the logging context, you can specify the logging context name as part of a naming hierarchy. In a naming hierarchy, the logging context names are separated by a period (for example, com.sas.services.event). If a call to a logging context named com.sas.services.event is made and there is no logging context for com.sas.services.event, then the Logging Service looks for a logging context of com.sas.services. If there is no logging context for com.sas.services, then com.sas is used.

    When you define a logging context, you associate outputs with the logging context in order to specify where to send logging messages for that particular logging context.

    Note: To associate outputs with a logging context, you must first create the output definition.

  • Outputs: the output definition specifies an output destination for the logging messages. The Logging Service can send the log messages to a file, console, or socket.

To configure the Logging Service:

  1. In the SAS Management Console navigation tree, expand the Foundation Services Manager tree to locate and select the Logging Service that you want to modify. Right-click on the Logging Service and select Properties. The Logging Service properties appears.
  2. Select the Service Configuration tab and click Edit Configuration. The Logging Service Configuration window appears.
  3. On the Outputs tab, click New to add an output, or select an output and click Edit to edit an output. Enter the following information:
    ID
    specifies the name or identifier for the output.
    Layout Pattern
    specifies how to format the log message. For details about specifying layout patterns, see Pattern Layouts.
    Async
    specifies whether asynchronous logging is activated.
    Type
    specifies the output type. Valid values are File, Console, or Socket.

    • If File is selected, the tab contains these items:

      Fields when File Is Selected
      File specifies the file to use for output
      Append specifies whether to append the logging output to the existing output in the file. If Append is not selected, then any existing data in the file will be overwritten.
      ImmediateFlush specifies whether the contents of the log are emptied after each logging statement.

    • If Console is selected, the tab contains these items:

      Fields when Console Is Selected
      Target specifies the output destination. Valid values are System.out or System.err

    • If Socket is selected, the tab contains these items:

      Fields when Socket Is Selected
      Host specifies the socket host (machine name).
      Port specifies the socket port number.

    Click OK to return to the Logging Service Configuration window.

  4. On the Context tab, click New to add a context, or select a context and click Edit to edit a context. Enter the following information:
    Name
    specifies the name of the context.
    Priority
    specifies the priority level of the logging context. The priority levels are
    DEBUG
    displays the informational events that are most useful for debugging an application.
    INFO
    displays informational messages that highlight the progress of the application.
    WARN
    displays potentially harmful situations.
    ERROR
    displays error events that might allow the application to continue to run.
    FATAL
    displays very severe error events that will probably cause the application to abort.
    Chained
    specifies whether the context is chained. Chaining designates that the log message is processed by both the current context and also by logging contexts higher in the logging context hierarchy.
    Outputs
    specifies the output destinations for the context. Click Add to add an output. The Add Logging Service Output window appears. Select an output and click Add. Click OK.

    Click OK to return to the Logging Service Configuration window.

  5. Click OK to save the new Logging Service configuration to the metadata repository.