`
qq123zhz
  • 浏览: 526000 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

blazeds 自带的日志记录功能

    博客分类:
  • Flex
阅读更多

 在mxml添加<mx:TraceTarget level="1"/>,level代表日志等级,就是all,debug,info,error等。。。。

 在配置文件中打开:

<logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Debug">
            <properties>
                <prefix>[Flex] </prefix>
                <includeDate>true</includeDate>
                <includeTime>true</includeTime>
                <includeLevel>true</includeLevel>
                <includeCategory>true</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
    </logging>

 

tomcat console:

[Flex] 02/09/2011 16:38:38.812 [WARN] [Configuration] HttpFlexSession has not been registered as a listener in web.xml for this application so no events will be dispatched to FlexSessionAttributeListeners or FlexSessionBindingListeners. To correct this, register flex.messaging.HttpFlexSession as a listener in web.xml.
[Flex] 02/09/2011 16:38:38.890 [DEBUG] [Endpoint.FlexSession] FlexSession created with id '7FAD3A28CFC179E2783613C195B0B985' for an Http-based client connection.
[Flex] 02/09/2011 16:38:38.906 [INFO] [Endpoint.General] Channel endpoint my-amf received request.
[Flex] 02/09/2011 16:38:39.015 [DEBUG] [Endpoint.AMF] Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=null, responseURI=/1)
    (Array #0)
      [0] = (Typed Object #0 'flex.messaging.messages.CommandMessage')
        operation = 5
        correlationId = ""
        messageId = "EB7AB2B6-EFA3-6054-8930-09927DCCFAB0"
        timestamp = 0
        headers = (Object #1)
          DSId = "nil"
          DSMessagingVersion = 1
        destination = ""
        body = (Object #2)
        clientId = null
        timeToLive = 0

[Flex] 02/09/2011 16:38:39.156 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/1/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
      (Object #1)
        DSMPIO = (Typed Object #2 'flex.messaging.messages.MessagePerformanceInfo')
          serverPreAdapterTime = 0.0
          serverPreAdapterExternalTime = 0.0
          infoType = null
          sendTime = 1.29724071914E12
          recordMessageTimes = false
          serverPrePushTime = 0.0
          pushedFlag = false
          serverPostAdapterExternalTime = 0.0
          receiveTime = 0.0
          messageSize = 0.0
          overheadTime = 0.0
          recordMessageSizes = false
          serverPostAdapterTime = 0.0
        DSMessagingVersion = 1.0
        DSId = "655EA75C-C708-C158-A04B-EEACB497D065"
1.297240719031E12
(Byte Array #3, Length 16)
(Byte Array #4, Length 16)
(Byte Array #5, Length 16)

[Flex] 02/09/2011 16:38:39.203 [INFO] [Endpoint.General] Channel endpoint my-amf received request.
[Flex] 02/09/2011 16:38:39.218 [DEBUG] [Endpoint.AMF] Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=null, responseURI=/2)
    (Array #0)
      [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
        source = null
        operation = "sayHello"
        messageId = "E2EC4EA3-01CB-F22C-0CCB-09927D7EA4CB"
        timestamp = 0
        headers = (Object #1)
          DSId = "655EA75C-C708-C158-A04B-EEACB497D065"
          DSEndpoint = "my-amf"
        destination = "FirstJavaClassRemoteObject"
        body = (Array #2)
          [0] = "hi~你好"
        clientId = null
        timeToLive = 0

[Flex] 02/09/2011 16:38:39.218 [DEBUG] [Service.Remoting] Adapter 'java-object' called 'com.test.FirstJavaClass.sayHello(java.util.Arrays$ArrayList (Collection size:1)
  [0] = hi~你好
)'
[Flex] 02/09/2011 16:38:39.218 [DEBUG] [Service.Remoting] Result: '你说的是:hi~你好'
[Flex] 02/09/2011 16:38:39.218 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/2/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
      "你说的是:hi~你好"
(Object #1)
        DSMPIO = (Typed Object #2 'flex.messaging.messages.MessagePerformanceInfo')
          serverPreAdapterTime = 0.0
          serverPreAdapterExternalTime = 0.0
          infoType = null
          sendTime = 1.297240719218E12
          recordMessageTimes = false
          serverPrePushTime = 0.0
          pushedFlag = false
          serverPostAdapterExternalTime = 0.0
          receiveTime = 0.0
          messageSize = 0.0
          overheadTime = 0.0
          recordMessageSizes = false
          serverPostAdapterTime = 0.0
1.297240719218E12
(Byte Array #3, Length 16)
(Byte Array #4, Length 16)
(Byte Array #5, Length 16)

  flex console:

0AE5DD11-6F38-C4D2-9B38-09927560A495' producer set destination to 'FirstJavaClassRemoteObject'.
'0AE5DD11-6F38-C4D2-9B38-09927560A495' producer sending message 'E2EC4EA3-01CB-F22C-0CCB-09927D7EA4CB'
'my-amf' channel endpoint set to http://localhost:8080/flex_blazeds3/messagebroker/amf
'my-amf' channel settings are:
<channel id="my-amf" type="mx.messaging.channels.AMFChannel">
  <endpoint uri="http://{server.name}:{server.port}/flex_blazeds3/messagebroker/amf"/>
  <properties/>
</channel>
'my-amf' pinging endpoint.
'my-amf' channel is connected.
'my-amf' channel sending message:
(mx.messaging.messages::RemotingMessage)#0
  body = (Array)#1
    [0] "hi~你好"
  clientId = (null)
  destination = "FirstJavaClassRemoteObject"
  headers = (Object)#2
  messageId = "E2EC4EA3-01CB-F22C-0CCB-09927D7EA4CB"
  operation = "sayHello"
  source = (null)
  timestamp = 0
  timeToLive = 0
'0AE5DD11-6F38-C4D2-9B38-09927560A495' producer connected.
'0AE5DD11-6F38-C4D2-9B38-09927560A495' producer acknowledge of 'E2EC4EA3-01CB-F22C-0CCB-09927D7EA4CB'.

 

 

分享到:
评论
3 楼 Fx_demon 2014-09-17  
Java代码:

@Service("loginService")
@RemotingDestination(channels = { "my-amf" })
public class LoginService implements ILoginService {

@Autowired
private LoginDao loginDao;


@RemotingInclude
public String getInfo() {
return  "你好 。。。访问成功 。。。嘻嘻嘻  ";
}

MXML:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx">

<fx:Declarations>
<!-- "productService" is defined in Spring's configuration file WEB-INF/config/web-application-config.xml
and provides remote access to the org.springframework.flex.samples.product.ProductDAO class -->
<mx:ChannelSet id="channelSet">
<mx:AMFChannel url="/flex-spring-mobile/messagebroker/amf"/>
</mx:ChannelSet>
<s:RemoteObject id="service" channelSet="{channelSet}"
destination="loginService">
<s:method name="getInfo" result="method1_resultHandler(event)"/>
</s:RemoteObject>
<s:RemoteObject id="ro" destination="loginService" endpoint="http://127.0.0.1:8080/flex-spring-mobile/messagebroker/amf" fault="ro_faultHandler(event)"   result="handlResult(event)" />
</fx:Declarations>

<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;

private function getData():void{
ro.getInfo();
}

private function handlResult(e:ResultEvent):void
{
Alert.show(e.result.toString());
trace(e.result);
}

protected function ro_faultHandler(event:FaultEvent):void
{
// TODO Auto-generated method stub
Alert.show(event.message.toString());
}

protected function method1_resultHandler(event:ResultEvent):void
{
// TODO Auto-generated method stub
service.getInfo();
}

]]>
</fx:Script>
<!--<mx:DataGrid dataProvider="{ro.findAll.lastResult}" width="100%" height="100%"/>-->

<!-- the findAll() method is defined in org.springframework.flex.samples.product.ProductDAO -->
<s:Button label="Get Info" click="ro.getInfo()"/>
<mx:Button click="getData()" x="278.5" y="186"  label="go-----点击" width="153"/>
</s:Application>


2 楼 Fx_demon 2014-09-17  
flex 访问 spring BlazeDS 时  访问不到 求解 ?
1 楼 Fx_demon 2014-09-17  
[BlazeDS]Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=null, responseURI=/1)
    (Array #0)
      [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
        source = null
        operation = "getStocks"
        body = (Array #1)
        timeToLive = 0
        timestamp = 0
        clientId = null
        destination = "feedManager"
        headers = (Object #2)
          DSId = "5D29E406-F0D8-8295-6A0A-B9A3960CA42F"
          DSEndpoint = null
        messageId = "178988F1-D5F8-6385-5845-822E2015D25E"

[BlazeDS]Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/1/onStatus, responseURI=)
    (Typed Object #0 'flex.messaging.messages.ErrorMessage')
      headers = (Object #1)
      rootCause = null
      body = null
      correlationId = "178988F1-D5F8-6385-5845-822E2015D25E"
      faultDetail = null
      faultString = "No destination with id 'feedManager' is registered with any service."
      clientId = "5D29EBA8-10E8-5546-6147-626F689A436F"
      timeToLive = 0.0
      destination = "feedManager"
      timestamp = 1.410933334294E12
      extendedData = null
      faultCode = "Server.Processing"
      messageId = "5D29EC6B-608F-DCB9-75A0-C29998F2BE3F"

相关推荐

Global site tag (gtag.js) - Google Analytics