Skip Headers
Oracle® Communications Services Gatekeeper System Administrator's Guide
Release 5.0

Part Number E16623-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

14 Managing and Configuring the Trace Service

This chapter describes how to configure and manage the Trace service in Oracle Communications Services Gatekeeper.

Introduction to the Trace Service

The Trace service is based on Log4J. Oracle Communications Services Gatekeeper maintains the log file, named default.log. Each service instance writes to this log file, the local file system of the server on which it executes. The trace service writes log files in the Domain_home/servers/server name/trace directory.

Basic tracing

For basic tracing, the root logger rootdefault maintains the trace file.

Following is a list of attributes and operations for configuration and maintenance for basic tracing:

Context trace

Context tracing generates log messages filtered on the context of a request,, in addition to basic tracing; for example, for a certain service provider or application. New context trace files can be added, and context filters and context categories can be applied to these files. Context categories can be added to the context trace file to log messages from one or more Oracle Communications Services Gatekeeper services. For example, to log messages from the Budget service and the Short Message Peer-to-Peer Protocol (SMPP) plug-in to a context trace file, the context categories for these are added to the context trace file. Context trace filters narrow the generated log messages to requests that match a given context filter. A context filter has predefined filter types that define what to filter on. For a given filter type, the value to match is defined. This is used for tracing on individual service providers, applications, and so on.

The workflow for defining a context trace file is:

  1. In the Oracle Communications Services Gatekeeper Administration Console, choose Container Services >TraceService .

  2. Select Operation: createContextTraceFile, or Operation: createRootContextTraceFile.

  3. For each context category to add for the context trace file, use Operation: addContextCategory.

  4. For each context filter to add, use Operation: addContextFilter.

Reference: Attributes and Operations for Trace Service

Managed object: Container Services−>TraceService

MBean: com.bea.wlcp.wlng.log.management.TraceServiceMBean

Following is a list of attributes and operations for configuration and maintenance:

Attribute: TracingEnabled

Scope: Cluster

Unit: Not applicable

Format: Boolean

Specifies whether trace should be enabled or not.

Use:

  • true to enable tracing

  • false to disable tracing

Operation: addContextCategory

Scope: Cluster

Adds a Log4J context category.

Signature:

addContextCategory(Identifier: String, Category: String)

Table 14-1 describes these parameters.

Table 14-1 addContextCategory

Parameter Description

Identifier

ID of a context trace file.

Category

The Log4J category. The category is the package name, including subpackages, to trace on.

For example, to trace on the SMPP plug-in, enter com.bea.wlcp.wlng.plugin.sms.smpp.


Operation: addContextFilter

Scope: Cluster

Adds one of the predefined filter types to the appender with the identified name.

The filter is a name/value pair, where the type identifies the filter type to use, and the value is the value of the filter.

All trace information that matches the filter is written to the context trace file.

When the Trace service receives information about a request, it checks if the request matches the context filter. If it matches, the trace information is written to file. All filters must match for the trace to be written.

Examples:

To add a filter that matches all requests from service provider ID SP1, set the type to SERVICE_PROVIDER and the value to SP1.

To add a filter that matches all requests from application ID APP1, set the typetto APPLICATION and the value to APP1.

Signature:

addContextFilter(identifier: String, type: String, value: String)

Table 14-2 describes these parameters.

Table 14-2 addContextFilter

Parameter Description

Identifier

ID of a context trace file.

Type

One of the defined types to filter on. Use:

  • SERVICE_PROVIDER to filter on service provider ID.

  • APPLICATION to filter on application ID.

  • APPLICATION_INSTANCE to filter on application instance ID.

  • SESSION to filter on session ID.

  • TRANSACTION to filter on transaction ID.

Value

Value to filter on for this filter type.


Operation: attachAppender

Scope: Cluster

Allows adding a named appender to named loggers. Each Oracle Communications Services Gatekeeper internal service has a default FileAppender that outputs to a file with the same name as the Oracle Communications Services Gatekeeper internal service.

Signature:

attachAppender(LoggerName: String, AppenderName: String)

Table 14-3 describes these parameters.

Table 14-3 attachAppender

Parameter Description

LoggerName

Name of logger.

AppenderName

Name of Oracle Communications Services Gatekeeper internal service to attach the appender to.


Operation: createContextTraceFile

Scope: Cluster

Creates a new context trace file.

Signature:

createContextTraceFile(Identifier : String, Category: String, Threshold: String)

Table 14-4 describes these parameters.

Table 14-4 createContextTraceFile

Parameter Description

Identifier

ID of the context trace file to create. Also the name of the trace file. The filename has the suffix .log.

Must be unique per managed server.

Category

The Log4J category.

Threshold

The threshold for the context trace file. Valid values are:

  • OFF

  • FATAL

  • ERROR

  • WARN

  • INFO

  • DEBUG

  • TRACE

  • ALL


Operation: createRootContextTraceFile

Scope: Cluster

Creates a new root context trace file. Adds a context trace file under root trace directory and associates it with the root logger

Signature:

createRootContextTraceFile(Identifier: String)

Table 14-5 describes this parameter.

Table 14-5 createRootContextTraceFile

Parameter Description

Identifier

ID of the root context trace file. Also the name of the trace file. The filename has the suffix .log.

Must be unique per managed server.


Operation: flushBuffers

Scope: Cluster

Flushes trace buffers to file. This operation affect only FileAppenders or subclasses.

Signature:

flushBuffers()

Operation: removeContextTraceFile

Scope: Cluster

Removes a context trace file.

Signature:

removeContextTraceFile(Identifier: String)

Table 14-6 describes this parameter.

Table 14-6 removeContextTraceFile

Parameter Description

Identifier

ID of the context trace file to remove.


Operation: resetContextFilters

Scope: Cluster

Resets all filters associated with a context trace file.

Signature:

resetContextFilters(Identifier: String)

Table 14-7 describes this parameter.

Table 14-7 resetContextFilters

Parameter Description

Identifier

ID of the context trace file to reset all filters for.


Operation: rollOver

Scope: Cluster

Rotates log files. This will invoke the rollOver() method on all registered RollingFileAppenders.

Signature:

rollOver()

Log4J Hierarchies, Loggers, and Appenders

There is a set of Log4J Dynamic MBeans shipped with Oracle Communications Services Gatekeeper that come by default with appenders. One Log4J hierarchy defined and one location are defined and displayed as follows in the following entries in the Oracle Communications Services Gatekeeper Administration Console under Log4J:

The rootDefault logger is connected, to the default hierarchy:

Additional loggers can be added, and additional appenders can be added to the loggers. It is possible to change both the priority of the logger and the appender to use. Parameters for the loggers and appenders can be configured.

The set of default appenders are defined as follows:

To persist Log4J settings, use the configuration file:

$Domain_Home/log4j/log4jconfig.xml

Configuring Trace for Access Tier servers

Unlike trace configuration for Network Tier servers, which is performed through the Oracle Communications Services Gatekeeper Administration Console, in Server Name > Log4J , for Access Tier servers, there are no management attributes or operations exposed in the Administration Console. This configuration must be done directly on the MBeans using a JMX-based Administration Console such as JConsole or using WLST.

For example, if you are using WLST, connect to the MBean server as described in WebLogic Scripting Tool (WSLT) and change to the custom tree where Oracle Communications Services Gatekeeper MBeans are located. Change to the Log4J directory: cd('log4J').

The settings for the Access Tier servers can be changed in the following directories:

For example, to change the trace level for the Access Tier servers for the appender log4j:appender=default to WARN:

cd('log4j:appender=default')
set('threshold','WARN')

Using the Log4J Configuration File

In addition to using the Log4J MBeans, trace can be configured using the file:

Domain_Home/log4j/log4jconfig.xml

The file contains by default an empty skeleton.

The settings defined in this file are read every 30 seconds.

The ordering of the elements must be taken into account. Appenders must be declared before categories.

When using appenders that write to a file, the files are stored in Domain_Home.

Example Log4J Configuration file

Following is an example where the following named appenders are declared:

  • MyRootLogger

  • MyMultimediaMessagingWarningLogger

  • MyAccountContainerLogger

All these appenders use the same class, org.apache.log4j.FileAppender.

Each appender writes to a file whose name is given in the <param name="File" value="<File name>"/> element. The appenders also use the same layout class, org.apache.log4j.PatternLayout, and ConversionPattern.

The appenders are used by a set of categories, where the name attribute defines which class to trace. The categories also define which Log4J priority that shall be logged.

In the example, the following services are logged:

Everything under:

  • com.bea.wlcp.wlng.account, which is the Account service.

  • com.bea.wlcp.wlng.plugin.multimediamessaging, which is the Parlay X Multimedia Messaging communication service.

Example 14-1 Example log4jconfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="MyRootLogger" class="org.apache.log4j.FileAppender">
<param name="File" value="A1.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
</layout>    
</appender>                 
<appender name="MyMultimediaMessagingWarningLogger" class="org.apache.log4j.FileAppender">
<param name="File" value="MMS_WARN.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
</layout>    
</appender>           
<appender name="MyAccountContainerLogger" class="org.apache.log4j.FileAppender">
<param name="File" value="Account.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</layout>    
</appender>           
<category name="org.apache.log4j.xml">
<priority value="info"/>    
</category>
<!-- log for a certain service... -->
<category name="com.bea.wlcp.wlng.account">
<priority value="DEBUG"/>
<appender-ref ref="MyAccountContainerLogger"/>
</category>  
<!-- end log for a certain service... -->
<!-- log for a certain service... -->
<category name="com.bea.wlcp.wlng.plugin.multimediamessaging">
<priority value="WARN"/>
<appender-ref ref="MyMultimediaMessagingWarningLogger"/>
</category>  
<!-- end log for a certain service... -->
<root>
<priority value="debug"/>
<appender-ref ref="MyRootLogger"/>
</root>
</log4j:configuration>