1 / 14

Better Logging in ColdFusion

Better Logging in ColdFusion. With examples for MX 7 Enterprise and all lower versions. How Logging Works. Webserver logging Third Party logging Application logging. Webserver Logging. Text files OR Database Huge amount of useless data Usually need a separate program to view

cree
Download Presentation

Better Logging in ColdFusion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Better Logging in ColdFusion With examples for MX 7 Enterprise and all lower versions

  2. How Logging Works • Webserver logging • Third Party logging • Application logging

  3. Webserver Logging • Text files OR Database • Huge amount of useless data • Usually need a separate program to view • Usually ignored • Bulky

  4. Third Party Logging • No control • Only what they give you • No control

  5. Application Logging • Allows for better control • More control and playing with the data = more overhead • Can be a bottleneck • Slower user sessions

  6. Solution • Throw the logging to another service • ColdFusion MX 7 Enterprise: • Asynchronous Gateway Services • ColdFusion MX 7 Pro (and earlier) • Application scope

  7. Solution • Take all the data you want to store • Throw it to somewhere else • Have the data manipulated and stored ‘outside’ the user session • Results in clean, tight data

  8. Asynchronous Gateways • Set up in the ColdFusion Admin • Calls a CFC • Is invoked by using the SendGatewayMessage() function • Sends a structure to the CFC • All work done ‘outside’ the user session

  9. Asynchronous Gateways

  10. Asynchronous Gateways • <CFCOMPONENT output="false"> • <cffunction name="SiteLog" access="public" returntype="void" output="false"> • <cfargument name="CFEvent" type="struct" required="yes"> • </cffunction> • </CFCOMPONENT>

  11. Asynchronous Gateways • sLogData=StructNew(); • sLogData.method="SiteLog"; • sLogData.Query_String=CGI.Query_String; • sLogData.Path_Info=cgi.Path_Info; • sLogData.Script_Name=cgi.Script_Name; • sLogData.SiteID=1; • sLogData.LogType=1; • sLogData.cfid=client.CFID; • sLogData.cftoken=client.CFTOKEN; • sLogData.REQUEST_METHOD=CGI.REQUEST_METHOD; • sLogData.HTTP_REFERER=cgi.HTTP_REFERER; • sLogData.REMOTE_ADDR=cgi.REMOTE_ADDR; • sLogData.http_user_agent=cgi.http_user_agent; • SendGatewayMessage('Asynch Logger', sLogData);

  12. Asynchronous Gateways

  13. Asynchronous Gateways

  14. Application Gateways • Works with all versions of ColdFusion with CFAPPLICATION • Stores same structure to an application structure • Structure is read by a scheduled task • REMEMBER TO LOCK!!!

More Related