MACROMEDIA COLFUSION MX 7-CFML Reference page 980

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

getLogger
Description
Returns a ColdFusion Logger object that the event gateway can use to log information in a file.
Category
Event Gateway Development
Syntax
coldfusion.eventgateway.Logger getLogger([String logfile])
See also
, "Logging events and using log files" in Chapter 45, "Creating Custom Event
Logger class
Gateways" in ColdFusion MX Developer's Guide
Parameters
Parameter
logfile
Returns
A ColdFusion MX logger object to use in
Usage
The Logger class has five methods:
severity level that is set in the log message. Each method takes a message string, a Throwable class
object, or both.
If you pass a Throwable object to these methods, ColdFusion MX writes the exception
information in the exceptions.log file.
Example
The ColdFusion MX example DirectoryWatcherGateway includes the following line in the
constructor to get a logger object:
// We create our own log file, which will be named "watcher.log"
logger = gatewayService.getLogger("watcher");
The following code, from the start of the routine that loads information from the configuration
file, uses this object to log the initialization.
// Load the properties file to get our settings
protected void loadconfig() throws ServiceRuntimeException
{
// load config
logger.info("DirectoryWatcher (" + gatewayID + ") Initializing
DirectoryWatcher gateway with configuration file " + config);
.
.
.
980
Chapter 6: ColdFusion MX Event Gateway Reference
Description
The name, without an extension, of a log file in the ColdFusion MX logs directory.
ColdFusion MX automatically appends a .log extension to the name. If the file does
not exist, ColdFusion MX creates it when it logs the first message. By default,
ColdFusion logs to the eventgateway.log file.
debug
,
,
,
, and
info
warn
error
, that correspond to the
fatal

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents