LCDS 日志配置

Server-side logging

You perform server-side logging for requests to and responses from the server. The following example shows a log message generated by the server:

 

[LCDS] 05/13/2008 14:27:18.842 [ERROR] [Message.General] Exception when invoking service: (none) with message: Flex Message (flex.messaging.messages.AsyncMessageExt)
    clientId = 348190FC-2308-38D7-EB10-57541CC2440A
    correlationId =
    destination = foo
    messageId = E0BFF004-F697-611B-3C79-E38956BAB21B
    timestamp = 1210703238842
    timeToLive = 0
    body = dsafasdasd: asdasd
    hdr(DSEndpoint) = my-rtmp
    hdr(DSId) = 348190D5-130A-1711-B193-25C4415DFCF5
    hdr(DSValidateEndpoint) = true
exception: flex.messaging.MessageException: No destination with id 'chat' is registered with any service.

You can configure the logging mechanism to specify the following information in the message:

  • The type of messages to log, called the log level. The available levels include All, Debug, Error, Info, None, and Warn. For example, you can choose to log Error messages, but not Info messages. For more information, see Setting the logging level.
  • The optional String prefixed to every log message. In this example, the String is [LCDS]. For more information, see Setting logging properties.
  • The display of the date and time of the log message. In this example, the message contains the date and time: 05/13/2008 14:27:18.842. For more information, see Setting logging properties.
  • The display of the level of the log message. In this example, the message contains the level: [ERROR]. For more information, see Setting logging properties.
  • The display of the category of the log message. The category provides information about the area of LiveCycle Data Services ES that generated the message. In this example, the message contains the level: [Message.General]. For more information, see Setting logging properties.
  • The target of the log messages. By default, log messages are written to System.out. For more information, see Setting the logging target.

Configuring server-side logging

Configure server-side logging in the logging section of the Flex services-config.xml configuration file. After you edit services-config.xml, restart the LiveCycle Data Services ES server.

The following example shows a configuration that sets the logging level to Debug:

<logging>
    <target class="flex.messaging.log.ConsoleTarget" level="Debug">
        <properties>
            <prefix>[LCDS]</prefix>
            <includeDate>false</includeDate>
            <includeTime>false</includeTime>
            <includeLevel>false</includeLevel>
            <includeCategory>false</includeCategory>
        </properties>
        <filters>
            <pattern>Endpoint.RTMP</pattern>
        </filters>
    </target>
</logging>

Setting the logging level

The level defines the types of messages written to the log. The following table describes the logging levels:

 

Logging level

Description

All

Logs all messages.

Debug

Logs debug message. Debug messages indicate internal Flex activities.

Select the Debug logging level to include Debug, Info, Warn, and Error messages in your log files.

Error

Logs error messages. Error messages indicate when a critical service is not available or a situation restricts use of the application.

Info

Logs information messages. Information messages indicate general information to the developer or administrator.

Select the Info logging level to include Info and Error messages in your log files.

None

No messages are logged.

Warn

Logs warning messages. Warning messages indicate that Flex encountered a problem with the application, but the application does not stop running.

Select the Warn logging level to include Warn and Error messages in your log files.

In a production environment, you typically set the logging level to Warn to capture both warnings and error messages. If you prefer to ignore warning messages, set the level to Error to display only error messages.

Setting the logging target

By default, the server writes log messages to System.out. In the class attribute of the target element, you can specify flex.messaging.log.ConsoleTarget (default) to log messages to the standard output, or the flex.messaging.log.ServletLogTarget to log messages to the default logging mechanism for servlets for your application server.

Setting logging properties

The following table describes the logging properties:

 

Property

Description

includeCategory

Determines whether the log message includes the category. The category provides information about the area of LiveCycle Data Services ES that generated the message. The default value is false.

includeDate

Determines whether the log message includes the date. The default value is false.

includeLevel

Determines whether the log message includes the log level. The categories are Debug, Error, Info, and Warn. Specifies to include the message category in the logging message. The default value is false.

includeTime

Determines whether the log message includes the time. The default value is false.

filters

Specifies a pattern that defines the categories to log. The category of a log message must match the specified pattern to be written to the log. For more information, see Setting a filtering pattern.

prefix

Specifies the String prefixed to log messages. The default value is an empty String.

In the following example, you set the configuration properties to display the category, date, level, time, and set the prefix to [LCDS]:

<logging>
    <target class="flex.messaging.log.ConsoleTarget" level="Debug">
        <properties>
 <prefix>[LCDS]</prefix>
 <includeDate>true</includeDate>
 <includeTime>true</includeTime>
 <includeLevel>true</includeLevel>
 <includeCategory>true</includeCategory>
        </properties>
    </target>
</logging>

Setting a filtering pattern

The <filters> property lets you filter log messages based on the message category. If you omit a setting for the <filters> property, messages for all categories are written to the log.

The following example shows the first line of log messages from different categories:

[LCDS] 05/14/2008 12:52:52.606 [DEBUG] [Endpoint.RTMP] Received command: TCCommand 
...
[LCDS] 05/14/2008 12:52:52.606 [DEBUG] [Message.General] Before invoke service: message-service
...
[LCDS] 05/14/2008 12:52:52.606 [DEBUG] [Service.Message] Sending message: Flex Message ...
[LCDS] 05/14/2008 12:52:52.606 [DEBUG] [Message.Timing] After invoke service: message-service; 

To filter messages so only those messages in the Message.General and Endpoint categories appear, set the <filters> property as the following example shows:

<logging>
    <target class="flex.messaging.log.ConsoleTarget" level="Debug">
        <properties>
            <prefix>[LCDS]</prefix>
            <includeDate>false</includeDate>
            <includeTime>false</includeTime>
            <includeLevel>false</includeLevel>
            <includeCategory>false</includeCategory>
        </properties>
 <filters>
 <pattern>Endpoint.*</pattern>
 <pattern>Message.General</pattern>
 </filters>
    </target>
</logging>

Use the wildcard character (*) in the pattern to log messages from more than one category. To see messages for all endpoints, specify a pattern of Endpoint.*. To see messages for only an RTMP endpoint, specify a pattern of Endpoint.RTMP. To see all messages for all categories, specify a pattern of *.

You can use many different patterns as the value of the pattern element, such as the following:

  • Client.*
  • Client.FlexClient
  • Client.MessageClient
  • Configuration
  • Endpoint.*
  • Endpoint.General
  • Endpoint.AMF
  • Endpoint.NIOAMF
  • Endpoint.FlexSession
  • Endpoint.HTTP
  • Endpoint.NIOHTTP
  • Endpoint.RTMP
  • Endpoint.StreamingAMF
  • Endpoint.StreamingHTTP
  • Endpoint.Type
  • Executor
  • Message.*
  • Message.General
  • Message.Command.*

For the complete list of filter patterns, see the services-config.xml file in the install_root/resources/config directory.

 

from: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=services_logging_3.html

你可能感兴趣的:(xml,Flex,Adobe)