Download presentation
Presentation is loading. Please wait.
Published byMarjory Andrews Modified over 8 years ago
1
Cool CF Debugging Shlomy Gantz 07/29/01CF_ODYSSEY
2
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Introduction - Famous Last words “…if “…if debugging is defined as the art of taking bugs out of a program, programming must be putting them in…” “..It’s “..It’s not a bug, It’s a feature “ (Microsoft)
3
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Types of bugs Syntax Syntax Error Run-Time Run-Time Errors Logical Logical Errors
4
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Types of bugs - Syntax Errors Syntax Error Example View Example View Example
5
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Types of bugs - Run-Time Errors Run-Time Error Example SELECT SUM(Salary) AS TotalSalary, COUNT(Emp_ID) as NumOfEmployees FROM AnnualSalary WHERE SALARY > 100000 #AVGSalary# View Example View Example
6
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Types of bugs - Logical Errors Logical Error example #YesNoFormat(ShlomyExists_YN)# View Example View Example
7
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Other things that can go wrong Database Database connection (ODBC,MDAC …) Cold Cold Fusion server Web Web Server OS Hardware
8
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging Steps Plan Back-up Isolate Find Find The error Fix Fix - Don’t patch Look Look for similar Document
9
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 “Debugger’s Block” If If all else fails … … and if that doesn’t work
10
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Cold Fusion Administrator
11
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Enable Performance Monitoring View Example View Example
12
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Enable CFML stack trace CF tracks what tags have run during page process. Can be used either through CFTRY/CFCATCH or the Studio Debugger Debugger
13
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Show Variables Show all variables processed by ColdFusion: FORM FORM URL URL CGI CGI Cookie Cookie
14
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Show Processing Time Show how long, in milliseconds, it takes for a page process to run to completion
15
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Detail View Breakdown of all templates run during a page process. Proccessing time for each template
16
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Show SQL and Datasource Name Shows SQL Statement & DSN in error messages
17
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Show Query Information Query Name RecordCount Processing Time Query Executed
18
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Display Template Path in Error Msg Show the name of the actual template in which the error occurred
19
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Restrict Debug Access By Default All when debugging is turned on all users can see debug information. Restrict access by IP address
20
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging with studio Setting up Development Mapping.
21
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Using the interactive debugger
22
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging CF applications Show Show your variables (not only once) Create Create breakpoints and Follow the flow Use Use Exception handling Look Look at your application logs
23
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 & Using CFABORT to create breakpoints Select * from Contacts WHERE Active_YN=1 #getContacts.recordcount#
24
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 & Following the flow Step 1 Step 1.1 Step 1.2 Step 2 View Example View Example
25
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging in CFML View Example View Example View Example View Example
26
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging CF applications
27
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 View Example View Example
28
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 ... Add code here ... Add exception processing code here ... Add exception processing code here ... Additional CFCATCH blocks go here ... Additional CFCATCH blocks go here
29
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01
30
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Application Logs Read your application logs regularly Error","TID=199","07/27/00","13:32:35","127.0.0.1","Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)","An error has occurred. HTTP/1.0 404 Object Not Found" "Error","TID=199","07/27/00","13:32:45","127.0.0.1","Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)","Error resolving parameter SLOT_IDColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either: You have misspelled the parameter name, or You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.The error occurred while evaluating the expression: #slot_id# The error occurred while processing an element with a general identifier of (#slot_id#), occupying document position (4:12) to (4:20) in the template file D:\wwwroot\cfun2000\Examples\JS\JSexample1_CFMW\edit_def.cfmThe specific sequence of files included or processed is:D:\WWWROOT\CFUN2000\EXAMPLES\JS\JSEXAMPLE1_CFMW\EDIT_DEF.CFM.Date/Time: 07/27/00 13:32:45Browser: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)Remote Address: 127.0.0.1HTTP Referer: http://127.0.0.1/cfun2000/Examples/JS/JSexample1_CFMW/EDIT.HTMLTemplate: D:\wwwroot\cfun2000\Examples\JS\JSexample1_CFMW\edit_def.cfm" "Warning","TID=152","07/27/00","15:07:21","In a CF_TagName construct custom tag file 'C:\CFUSION\CustomTags\Pages.cfm' will occlude custom tag file 'C:\CFUSION\CustomTags\cf_pages\Pages.cfm'." "Warning","TID=152","07/27/00","15:07:21","In a CF_TagName construct custom tag file 'C:\CFUSION\CustomTags\Pages.cfm' will occlude custom tag file 'C:\CFUSION\CustomTags\cf_pages\images\Pages.cfm'." View Example View Example
31
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 CF_Objectdump/ Read your application logs regularly <CF_ObjectDump Object="#Object#" Deserialize="yes|no" > <CFDUMP <CFDUMP var = #variable_name#> var = #variable_name#> View Example View Example
32
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging Databases SQL query analyzer View Example View Example
33
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging JavaScript “Microsoft Script debugger”/“Netscape JavaScript Debugger” Using alert() and return false;
34
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Debugging flash No debug output simulated flash requests output in flash
35
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Tools http://www.secretagents.com/ http://www.secretagents.com/ BugTraq ( BugTraq - Full ) BugTraq - Full BugTraq - Full http://www.logviewer.com/ http://www.logviewer.com/ Automatic Code Generation Tools CodeSaver / CodeCharge / CommerceBlocks CodeSaver / CodeCharge / CommerceBlocks CodeSaverCodeChargeCommerceBlocks CodeSaverCodeChargeCommerceBlocks
36
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 What’s new in 5.0 Easier Log Analysis
37
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 What’s new in 5.0 New options on CF Admin debug setting
38
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 Thank You Michael Dinowitz, Emily Kim, Michael Imhoff and Abraham Lloyd. … Michael Smith
39
“Cool CF Debugging - Copyright Shlomy Gantz 2001 – 07/29/01 QA Shlomy Gantz shlomygantz@hotmail.com http://www.shlomygantz.com
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.