7 Enabling Message Logging

This chapter describes how to use message logging features on a development system, in the following sections:

7.1 Overview

Message logging records SIP and Diameter messages (both requests and responses) received by OWLCS. This requires that the logging level be set to at least the INFO level. You can use the message log in a development environment to check how external SIP requests and SIP responses are received. By outputting the distinguishable information of SIP dialogs such as Call-IDs from the application log, and extracting relevant SIP messages from the message log, you can also check SIP invocations from HTTP servlets and so forth.

When you enable message logging, OWLCS records log records in the Managed Server log file associated with each engine tier server instance by default. You can optionally log the messages in a separate, dedicated log file, as described in "Configuring Log File Rotation".

7.2 Enabling Message Logging

You enable and configure message logging by adding a message-debug element to the sipserver.xml configuration file. OWLCS provides two different methods of configuring the information that is logged:

  • Specify a predefined logging level (terse, basic, or full), or

  • Identify the exact portions of the SIP message that you want to include in a log record, in a specified order

The sections that follow describe each method of configuring message logging functionality using elements in the sipserver.xml file. Note that you can also set these elements using the Administration Console, in the Configuration->Message Debug tab of the SipServer console extension node.

7.2.1 Specifying a Predefined Logging Level

The optional level element in message-debug specifies a predefined collection of information to log for each SIP request and response. The following levels are supported:

  • terse—Logs only the domain setting, logging Servlet name, logging level, and whether or not the message is an incoming message.

  • basic—Logs the terse items plus the SIP message status, reason phrase, the type of response or request, the SIP method, the From header, and the To header.

  • full—Logs the basic items plus all SIP message headers plus the timestamp, protocol, request URI, request type, response type, content type, and raw content.

Example 7-1 shows a configuration entry that specifies the full logging level.

Example 7-1 Sample Message Logging Level Configuration in sipserver.xml


7.2.2 Customizing Log Records

OWLCS also enables you to customize the exact content and order of each message log record. To configure a custom log record, you provide a format element that defines a log record pattern and one or more tokens to log in each record.


If you specify a format element with a <level>full</level> level element undefined) in message-debug, OWLCS uses "full" message debugging and ignores the format entry. The format entry can be used in combination with either the "terse" or "basic" message-debug levels.

Table 7-1 describes the nested elements used in the format element.

Table 7-1 Nested format Elements

param-name param-value Description


Specifies the pattern used to format a message log entry. The format is defined by specifying one or more integers, bracketed by "{" and "}". Each integer represents a token defined later in the format definition.


A string token that identifies a portion of the SIP message to include in a log record. Table 7-2 provides a list of available string tokens. You can define multiple token elements as needed to customize your log records.

Table 7-2 describes the string token values used to specify information in a message log record:

Table 7-2 Available Tokens for Message Log Records

Token Description Example or Type


The Call-ID header. It is blank when forwarding.



The raw content.

Byte array


The content length.

String value


The content type.

String value


The CSeq header. It is blank when forwarding.



The date when the message was received. ("yyyy/MM/dd" format)



The From header (all). It is blank when forwarding.



The address portion of the From header.



The tag parameter of the From header. It is blank when forwarding.



The SIP URI part of the From header. It is blank when forwarding.



A List of message headers stored in a 2-element array. The first element is the name of the header, while the second is a list of all values for the header.

List of headers


Whether the message is incoming or not.



The name of the SIP method. It records the method name to invoke when forwarding.



Summary Call ID

String value


The type of receiving.



The protocol used.



The response reason.



The request URI. This token is only available for the SIP request.



The response status.



The time when the message was received. ("HH:mm:ss" format)



Time stamp in milliseconds.



The To header (all). It is blank when forwarding.



The address portion of the To header.



The tag parameter of the To header. It is blank when forwarding.



The SIP URI part of the To header. It is blank when forwarding.


See "Example Message Log Configuration and Output" for an example sipserver.xml file that defines a custom log record using two tokens.

7.3 Specifying Content Types for Unencrypted Logging

By default OWLCS uses String format (UTF-8 encoding) to log the content of SIP messages having a text or application/sdp Content-Type value. For all other Content-Type values, OWLCS attempts to log the message content using the character set specified in the charset parameter of the message, if one is specified. If no charset parameter is specified, or if the charset value is invalid or unsupported, OWLCS uses Base-64 encoding to encrypt the message content before logging the message.

If you want to avoid encrypting the content of messages under these circumstances, specify a list of String-representable Content-Type values using the string-rep element in sipserver.xml. The string-rep element can contain one or more content-type elements to match. If a logged message matches one of the configured content-type elements, OWLCS logs the content in String format using UTF-8 encoding, regardless of whether or not a charset parameter is included.


You do not need to specify text/* or application/sdp content types as these are logged in String format by default.

Example 7-2 shows a sample message-debug configuration that logs String content for three additional Content-Type values, in addition to text/* and application/sdp content.

Example 7-2 Logging String Content for Additional Content Types


7.4 Example Message Log Configuration and Output

Example 7-3 shows a sample message log configuration in sipserver.xml. Example 7-4, "Sample Message Log Output" shows sample output from the Managed Server log file.

Example 7-3 Sample Message Log Configuration in sipserver.xml

      <pattern>{0} {1}</pattern>

Example 7-4 Sample Message Log Output

####<Aug 10, 2005 7:12:08 PM PDT> <Info> <WLSS.Trace> <jiri.bea.com> <myserver> <ExecuteThread: '11' for queue: 'sip.transport.Default'> <<WLS Kernel>> <> <BEA- 331802> <SIP Tracer: logger Message: To: sut <sip:invite@> <mailto:sip:invite@> 
Content-Length: 136
Contact: user:user@
Call-ID: 59.3170.
From: user <sip:user@> <mailto:sip:user@> ;tag=59
Via: SIP/2.0/UDP
Content-Type: application/sdp
Subject: Performance Test
Max-Forwards: 70
o=user1 53655765 2353687637 IN IP4
c=IN IP4
t=0 0
m=audio 10000 RTP/AVP 0
a=rtpmap:0 PCMU/8000
####<Aug 10, 2005 7:12:08 PM PDT> <Info> <WLSS.Trace> <jiri.bea.com> <myserver> <ExecuteThread: '11' for queue: 'sip.transport.Default'> <<WLS Kernel>> <> <BEA- 331802> <SIP Tracer: logger Message: To: sut <sip:invite@> <mailto:sip:invite@> 
Content-Length: 0
Call-ID: 59.3170.
Via: SIP/2.0/UDP
From: user <sip:user@> <mailto:sip:user@> ;tag=59
Server: Oracle WebLogic Communications Server

7.5 Configuring Log File Rotation

Message log entries for SIP and Diameter messages are stored in the main OWLCS log file by default. You can optionally store the messages in a dedicated log file. Using a separate file makes it easier to locate message logs, and also enables you to use OWLCS's log rotation features to better manage logged data.

Log rotation is configured using several elements nested within the main message-debug element in sipserver.xml. As with the other XML elements described in this section, you can also configure values using the Configuration->Message Debug tab of the SIP Server Administration Console extension.

Table 7-3 describes each element. Note that a server restart is necessary in order to initiate independent logging and log rotation.

Table 7-3 XML Elements for Configuring Log Rotation

Element Description


Determines whether a separate log file is used to store message debug log messages. By default, this element is set to false and messages are logged in the general log file.


Configures the minimum size, in kilobytes, after which the server automatically rotate log messages into another file. This value is used when the rotation-type element is set to bySize.


Defines the name of the log file for storing messages. By default, the log files are stored under domain_home/servers/server_name/logs.


Configures the criterion for moving older log messages to a different file. This element may have one of the following values:

  • bySize—This default setting rotates log messages based on the specified file-min-size.

  • byTime—This setting rotates log messages based on the specified rotation-time.

  • none—Disables log rotation.


Specifies whether or not the server places a limit on the total number of log files stored after a log rotation. By default, this element is set to false.


Configures the maximum number of log files to keep when number-of-files-limited is set to true.


Determines whether the server must rotate the log file at server startup time.


Configures a directory in which to store rotated log files. By default, rotated log files are stored in the same directory as the active log file.


Configures a start time for log rotation when using the byTime log rotation criterion.


Specifies the interval, in hours, after which the log file is rotated. This value is used when the rotation-type element is set to byTime.


Specifies the pattern to use for rending dates in log file entries. The value of this element must conform to the java.text.SimpleDateFormat class.

Example 7-5 shows a sample message-debug configuration using log rotation.

Example 7-5 Sample Log Rotation Configuration

<?xml version='1.0' encoding='UTF-8'?>
<sip-server xmlns="http://www.bea.com/ns/wlcp/wlss/300" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls">
    <date-format-pattern>MMM d, yyyy h:mm a z</date-format-pattern>