Copy link to clipboard
Copied
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_date | userid | cfc_filename | function_called | arguments | ... |
---|---|---|---|---|---|
05/28/2009 10:05 | myUser1 | folder1/sales.cfc | getMainNumbers | - dptName : 'test' - area : 'test' - company : 'test' | |
05/28/2009 10:07 | User2 | folder2/home.cfc | getUserList | -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
Copy link to clipboard
Copied
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 !