CFDUMP Enhancements

Coldfusion has a beauty and that is CFDUMP. But very few of CFers know about enhancements made in CFDUMP that provides control over what to show and what not to in a dump result. You can indicate columns of query or keys of structure to show. It has show/hide attribute to do so.


<cfdump var="#myquery#" show="col1,col2">
<cfdump var="#myquery#" hide="col1,col2">
<cfdump var="#mystructure#" show="key1,key2">
<cfdump var="#mystructure#" hide="key1,key2">


  • How many Keys to display in dump result.

[code:cf]<cfdump var="#mystructure#" keys="4">[/code]

  • We can control whether to show output to browser, console, or a file. It will be default to browser.console will be used to runtime log file if CF running as a service.

[code:cf]<cfdump var="#mystructure#" OUTPUT="browser|console|filename">[/code]

  • Format is new attribute and that has two attributes.

[code:cf]<cfdump var="#mystructure#" FORMAT="html|text">[/code]

  • Normally dump of query shows more information than actual data. Like number of records, queryparam values and some meta information. We can prevent this using a new attribute.

[code:cf]<cfdump var="#myquery#" METAINFO="no">[/code]