Skip to main content
Known Participant
May 28, 2009
Question

How to log flex -> cfc communication

  • May 28, 2009
  • 1 reply
  • 627 views

Hi,

I am working on a Flex application using remote objects and CF8.

I have dozen of cfc's with few functions inside.

What I want to realize is to log (in a database) every function called with their passed arguments (from flex) and the userid.

for example here's the information I want to store :

the_dateuseridcfc_filenamefunction_calledarguments...
05/28/2009 10:05myUser1folder1/sales.cfcgetMainNumbers

- dptName : 'test'

- area : 'test'

- company : 'test'

05/28/2009 10:07User2folder2/home.cfcgetUserList-area : 'test'

is it possible to do without changing the flex application and only using coldfusion (application.cfc + events)

I am already able to retrieve current connected users.

using this script (the authentication is done in a cfm page then it redirects to the Flex app with the userid)  :

<cfparam name="application.sessionTracker" default="#StructNew()#">

<cfset objLog = {

     userid = URL.value,

     in = now(),

     area = area

} />

<cfset dummy = structInsert(

     application.sessionTracker,

     URL.value,

     objLog, true)>  

Here's the structure of the different directories :

- FTP root

     - my Flex app folder

          . application.cfm

          . index.cfm   

          . myapp.swf

          .myapp.html

     - cfc's folder

          - folder 1

               . file1.cfc

               . file2.cfc

...

I hope that my question is clear

Regards,

Aubry

This topic has been closed for replies.

1 reply

aubwebAuthor
Known Participant
June 18, 2009

I reply to myself ;-)

I used the invoke event on each of my RemoteObject tags.

I also added a function on all result and fault event of my mx:method tags.

So each time a method is called, is successful or got an error it's written in a DB  !