`

LCDS 日志配置

    博客分类:
  • flex
阅读更多

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

分享到:
评论

相关推荐

    Lcds配置说明

    ### LCDs配置说明知识点详解 #### 一、LCDs简介 LCDs(LiveCycle Data Services)是Adobe提供的一款用于构建富互联网应用(RIA)的服务框架,尤其适用于与Flex结合使用。它提供了强大的后端服务支持,包括数据管理...

    Flex LCDS的例子

    5. **LCDS服务配置**:在Java环境中,需要配置LCDS服务,包括在服务器端部署LCDS服务组件,设置数据源和应用程序服务,以及在Flex客户端添加相应的服务引用。 6. **数据绑定和事件处理**:Flex的强项在于其数据绑定...

    lcds.rar_LCDS_LiveCycle Data Servi_LiveCycleDataService_flex_fle

    在实际开发中,`lcds.docx`这样的文档可能包含LCDS的配置指南、API参考、最佳实践或者示例代码,帮助开发者更好地理解和使用LCDS。通过深入学习和应用LCDS,开发者可以构建出响应迅速、功能丰富的Flex企业应用,提升...

    Flex + LCDS + Java 入门教程

    2. **LCDS了解**:讲解LCDS的安装和配置,以及如何在Flex项目中引入LCDS库。解释AMF协议的工作原理,以及它如何提高数据传输效率。 3. **Java与Flex的交互**:通过LCDS,学习如何在Java中创建服务,并将其绑定到...

    Flex与JAVA教程,lcds教程

    7. **性能优化**:了解如何配置和优化BlazeDS/LCDs以提升系统性能,包括缓存策略、线程池管理等。 8. **调试和监控**:学习如何使用Flex Builder的调试工具,以及如何通过日志和监控工具分析Flex与Java应用的运行...

    Flex+LCDS+J2EE系统的实现例子

    2. **LCDS中间层**:通过配置LCDS服务器,将Flex中的RemotingObject与Java服务进行映射。例如,创建一个`StudentService`接口,其中包含添加、删除、更新和查询学生信息的方法。当Flex应用调用这些方法时,LCDS会...

    Flex+Java+(lcds)源码

    LCDS(LiveCycle Data Services)是Adobe提供的一个组件,它为Flex与Java应用程序之间的数据交换提供了强大的支持。此"Flex+Java+LCDSS"项目源码结合了这些技术,旨在创建一个能够无缝通信的前端和后端系统。 一、...

    flex 3.0 sample

    6. **错误处理和调试**:学习在Flex和LCDS环境中如何有效地处理错误,进行调试和日志记录,确保应用的稳定性和可靠性。 7. **性能优化**:探讨如何优化Flex应用的性能,减少网络传输开销,提升用户交互体验。 通过...

    整合Flex和Java--配置篇

    3. **AMF配置**:为了实现更高效的通信,可以使用BlazeDS或LCDS(LiveCycle Data Services)等中间件,它们支持AMF协议,能提供二进制数据传输,提高性能。在Flex项目中配置相应的AMF通道,并在Java服务器端添加相应...

    flex的第一步,安装、配置、与tomcat的挂接

    确认 FlexBuilder 或 LCDS 已正确配置,并能识别 JOTM。 - **检查 DataService 配置**。在 Flex 应用程序的配置中,确保正确设置了事务管理器。 - **验证事务管理器类名**。确保使用的事务管理器类名正确无误。 ...

    Spring-Flex架构分析

    这是一个日志配置文件,通常用于定义日志记录级别、输出目的地和格式。在Spring-Flex项目中,日志管理是关键,因为它帮助开发者跟踪程序运行状态,排查错误。Log4j是一个广泛使用的日志框架,它允许灵活的日志配置,...

    BlazeDS.war

    日志可以通过服务器的日志系统(如Tomcat的catalina.out)或者自定义的日志配置进行查看。 10. **社区支持**:作为开源项目,BlazeDS拥有活跃的社区支持,开发者可以在Adobe官网或其他技术论坛找到丰富的文档、教程...

    BlazeDS实现flex与java通信

    同时,可以通过配置BlazeDS的日志输出来获取更详细的错误信息,帮助诊断问题。 总之,BlazeDS为Flex和Java应用程序间的通信提供了一个强大而灵活的解决方案,它简化了数据交换,并支持多种服务类型。通过熟练掌握...

    Flex如何连接数据库,通信的详细的教程

    利用Flex的调试工具和日志记录,可以定位并解决问题。对于AMF通信问题,检查服务器端和客户端的配置是否一致,数据序列化是否正确。 8. **异常处理** 对于可能出现的异常情况,如数据库连接失败、查询错误等,需在...

    java flex jar包

    可以通过配置BlazeDS或LCDS来实现安全控制。 7. **调试和日志记录**:为了排查问题,开发者需要了解如何在Flex和Java两端启用调试和日志记录。例如,使用Flex的`Trace`命令,Java的日志框架如Log4j,以及BlazeDS/...

    flex 与Java通讯

    3. 定义AMF通道:配置BlazeDS/LCDS,设置AMF通道,指定Java服务暴露给Flex客户端。 4. Flex客户端开发:在Flex应用中创建RemoteObject或HTTPService,指定Java服务的URL和方法名。 5. 数据交换:Flex客户端调用...

    flex_servlet_spring整合

    9. **调试和日志**:为了便于开发和调试,需要配置合适的日志框架(如Log4j)和Flex SDK的调试版本,以便跟踪客户端和服务端的错误和日志信息。 10. **性能优化**:在实际应用中,需要考虑性能优化,比如减少不必要...

    BlazeDS API

    2. **消息代理**:BlazeDS提供了LiveCycle Data Services(LCDS)中的一部分消息代理服务,允许客户端和服务器之间进行双向通信。通过Topic和Channel,可以实现发布/订阅模式的消息传递,支持事件驱动的编程模型。 ...

    flex整合java

    `RemoteObject`通过配置映射到Java服务,使得在Flex中可以像调用本地方法一样调用远程服务。 5. **数据模型和数据绑定** Flex支持MXML数据绑定,可以轻松地将UI组件与数据模型关联。在与Java整合时,Flex客户端...

    flex与java整合专用jotm

    4. **JTA配置**:JOTM的配置文件`jotm.properties`或`transaction-service.xml`需要正确设置,以指定事务超时、日志位置和其他高级特性。在Flex与Java整合的场景下,还需要确保JTA环境被正确地暴露给BlazeDS或LCDS。...

Global site tag (gtag.js) - Google Analytics