Listing 1: DirectoryWatcher.cfc

<cfcomponent>
  <cffunction name="onAdd" output="no">
    <cfargument name="CFEvent" type="struct" required="yes">
    <cfset data = CFEvent.data>
    <cflog application="No"  file="ftpSentry"
                  text="ACTION: #data.type#;  FILE: #data.filename#; TIME: #timeFormat(data.lastmodified)#">
    <cftry>
      <cfmodule template="/myApp/index.cfm?fuseaction=system.checkInFTP">
      <cfcatch type="any">
        <cflog application="no"
               file="ftpSentry"
               text="ERROR: #cfcatch.Message#; TIME: #timeFormat(Now())#">
      </cfcatch>
    </cftry>
  </cffunction>
  
  <cffunction name="onDelete" output="no">
    <cfargument name="CFEvent" type="struct" required="yes">
    <cfset data = CFEvent.data>
    <cflog application="No" 
                  file="ftpSentry"
                  text="ACTION: #data.type#;  FILE: #data.filename# TIME: #timeFormat(data.lastmodified)#">
  </cffunction>
  
  <cffunction name="onChange" output="no">
    <cfargument name="CFEvent" type="struct" required="yes">
    <cfset data = CFEvent.data>
    <cflog application="No"
                  file="ftpSentry" 
                  text="ACTION: #data.type#;  FILE: #data.filename#; TIME: #timeFormat(data.lastmodified)#">
  </cffunction>
</cfcomponent>

Listing 2: ftpSentry.log

"Severity","ThreadID","Date","Time","Application","Message"
"Information","Thread-11","07/11/06","12:33:56",,"C:\CFusionMX7\logs\ftpSentry.log initialized"
"Information","Thread-11","07/11/06","12:33:56",,"ACTION: ADD;  FILE: C:\ftpSentry\ASDO200607112876.xml;
TIME: 07:45 PM"
"Information","Thread-11","07/11/06","12:34:56",," ACTION: DELETE;  FILE: C:\ftpSentry\C:\ftpSentry\ASDO200607112876.xml"