Skip to content

Instantly share code, notes, and snippets.

@cfmitrah
Created March 11, 2019 08:01
Show Gist options
  • Save cfmitrah/2eab8e2d77452e5a2ecf536e66ef3b3b to your computer and use it in GitHub Desktop.
Save cfmitrah/2eab8e2d77452e5a2ecf536e66ef3b3b to your computer and use it in GitHub Desktop.
Demo Lucee Event Gateway - Listener Component
<cfcomponent>
<cfset variables.logFileName = "demoLogGateway" />
<cffunction name="checkChange" access="public" output="no" returntype="void">
<cfargument name="data" type="struct" required="yes">
<cfset logDetails("change:#serialize(data)#", "information")>
</cffunction>
<cffunction name="logDetails" returntype="void" access="private" output="no">
<cfargument name="content" required="yes" type="string" />
<cfargument name="type" required="yes" type="string" />
<cflog text="#arguments.content#" type="#arguments.type#" file="#variables.logFileName#" />
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment