2015-01-13 3 views
-1

Linux에서 Flex 4.1을 사용하고 있지만이 문제는 모든 버전의 Flex에서 공통적으로 발생해야합니다.팝업 메시지를 표시하는 대신 "보내기 실패"를 파일에 기록하는 방법

BlazeDS를 통해 Java 백엔드 (Tomcat)에 연결하는 Flex 클라이언트 프런트 엔드에서 작업하고 있습니다. 이 모든 것은 99.9 %의 시간 동안 정상적으로 작동합니다. 그러나 때때로 (클라이언트 브라우저가 몇 시간 동안 열려 있다면) 사용자는 "보내기 실패"라는 팝업 메시지를받습니다. 무의미한 일시적인 오류 인 것 같습니다. 사용자가 팝업을 닫으면 프런트 엔드는 평소와 같이 계속 작동하고 계속 예상대로 작동하는 것 같습니다.

팝업 메시지를 열지 않고 "보내기 실패"메시지를 로그 파일에 기록하는 방법이 있습니까?

별도의 문제로 일시적인 "보내기 실패"오류가 발생했다면 그에 대해 듣고 싶습니다. 당신이 그들을 떠나게하는 해결책이 있다면 그것은 대단 할 것입니다.

+0

별도의 문제는 별도의 질문을해야한다. – splash

답변

1

해결 방법 1 : 응용 프로그램의 로그가 "flashlog.txt"파일 (Log file location 참조)됩니다를 사용하여 간단한 trace() feature

  1. mm.cfg 파일
  2. 을 1로 debugger version of Flash Player
  3. 설정 TraceOutputFileEnable 설치
  4. trace("message")을 사용하여 메시지를 "flashlog.txt"파일에 기록하십시오.

해결 방법 2 : Use logging API는 :

<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" 
    creationComplete="initLogging();" 
    height="600"> 

    <s:layout> 
     <s:VerticalLayout/> 
    </s:layout> 

    <fx:Script> 
     <![CDATA[ 
     import mx.collections.ArrayCollection; 
     import mx.logging.targets.*; 
     import mx.logging.*; 

     [Bindable] 
     public var myData:ArrayCollection; 

     private function initLogging():void { 
      /* Create a target. */ 
      var logTarget:TraceTarget = new TraceTarget(); 

      /* Log only messages for the classes in the mx.rpc.* and 
       mx.messaging packages. */ 
      logTarget.filters=["mx.rpc.*","mx.messaging.*"]; 

      /* Log all log levels. */ 
      logTarget.level = LogEventLevel.ALL; 

      /* Add date, time, category, and log level to the output. */ 
      logTarget.includeDate = true; 
      logTarget.includeTime = true; 
      logTarget.includeCategory = true; 
      logTarget.includeLevel = true; 

      /* Begin logging. */ 
      Log.addTarget(logTarget); 
     } 
     ]]> 
    </fx:Script> 

    <fx:Declarations> 
     <!-- HTTPService is in the mx.rpc.http.* package --> 
     <mx:HTTPService id="srv" 
      url="../assets/trace_example_data.xml" 
      useProxy="false" 
      result="myData=ArrayCollection(srv.lastResult.data.result)"/> 
    </fx:Declarations> 

    <mx:LineChart id="chart" dataProvider="{myData}" showDataTips="true"> 
     <mx:horizontalAxis> 
      <mx:CategoryAxis categoryField="month"/> 
     </mx:horizontalAxis> 
     <mx:series> 
      <mx:LineSeries yField="apple" name="Apple"/> 
      <mx:LineSeries yField="orange" name="Orange"/> 
      <mx:LineSeries yField="banana" name="Banana"/> 
     </mx:series> 
    </mx:LineChart> 

    <s:Button id="b1" click="srv.send();" label="Load Data"/> 

</s:Application> 
관련 문제