User Guide

276 Chapter 2: ColdFusion Tags
cflog
Description
Writes a message to a log file.
Category
Data output tags
Syntax
<cflog
text = "text"
log = "log type"
file = "filename"
type = "message type"
application = "yes" or "no">
See also
cfcol, cfcontent, cfoutput, cftable
History
ColdFusion MX: Deprecated the thread, date, and time attributes. They might not work, and
might cause an error, in later releases. (In earlier releases, these attributes determined whether the
respective data items were output to the log. In ColdFusion MX, this data is always output.)
Attributes
Attribute Req/Opt Default Description
text Required Message text to log.
log Optional If you omit the
file attribute, writes messages to standard
log file. Ignored, if you specify
file attribute.
Application: writes to Application.log, normally used for
application-specific messages.
Scheduler: writes to Scheduler.log, normally used to log
the execution of scheduled tasks.
file Optional Message file. Specify only the main part of the filename. For
example, to log to the Testing.log file, specify "Testing".
The file must be located in the default log directory. You
cannot specify a directory path. If the file does not exist, it is
created automatically, with the suffix .log.
type Optional Information Type (severity) of the message:
Information
Warning
Error
Fatal
application Optional yes yes: logs the application name, if it is specified in a
cfapplication tag or Application.cfc file.
no