Description

Writes a log entry with a debugging severity to the ColdFusion logger. The entry includes the severity, thread ID, date, time, and a text message.

Category

Event Gateway Development

Syntax

debug(String message)
debug(Throwable th)
debug(String message, Throwable th)

See also

errorfatalinfowarngetLoggerLogging events and using log files in Building an event gateway in the Developing ColdFusion Applications

Parameters

Parameter

Description

message

The message to include in the log entry.

th

A throwable object, normally an exception. ColdFusion logs the exception information in the exception.log file in the ColdFusion logs directory.

Usage

Use this method to send a debugging message to the ColdFusion logging subsystem. By default, ColdFusion does not write debugging messages to the log file. To have debug messages appear in the log file, change the priority entry in cf_root\lib\neo-logging.xml (in the server configuration) or cf_root/WEB-INF\cfusion\lib\neo-logging.xml (in the J2EE configuration. Change the following entry:

<var name='priority'>
<string>information</string>
</var>

to the following:

<var name='priority'>
<string>debug</string>
</var>

With debug priority, ColdFusion writes messages with a severity of "debug" to the log file specified in the getLogger method that returned the Logger instance (or the default log file).

Example

The ColdFusion instant messaging gateways use the following line to log information about incoming administrative messages or errors only when debugging priority is on.

// code to process incoming administrative messages or errors
logger.debug(gatewayType + "Gateway (" + gatewayID + ") admin message: " +
msg.getMessage());

 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy