User Guide

Table Of Contents
1100 Chapter 45: Creating Custom Event Gateways
The Logger class has the following methods, all of which take a message string. The method you
use determines severity level that is set in the log message.
info
warn
error
fatal
You can also pass these methods an exception instance as a second parameter. When you do this,
CColdFusion MX puts the exception information in the exception.log file in the ColdFusion MX
logs directory.
You can use these methods to log any messages that you find appropriate. If you use the default
eventgateway.log file, however, remember that it is used by all ColdFusion MX standard gateways,
and might be used by other gateways. As a result, you should limit the messages that you normally
log to this file to infrequent normal occurrences (such as gateway startup and shutdown) or errors
for which you want to retain data.
ColdFusion MX uses the following format for the message text, and your application should
follow this pattern:
GatewayType (Gateway ID) Message
The SMS event gateway, for example, includes the following exception catching code, which logs
a general exception messages and the exception name in the eventgateway.log file, and also
(automatically) logs the exception in the exceptions.log file:
catch(Exception e)
{
logger.error("SMSGateway (" + gatewayID + ") Exception while processing
incoming event: " + e, e);
}
Note: When you are developing an event gateway application, you can use the ColdFusion Log
viewer to inspect your log files and the standard ColdFusion MX log files, including the
eventgateway.log file and exception.log file. You can use the viewer to filter the display, for example,
by selecting different severity levels, or searching for keywords.
Deploying an event gateway
To deploy an event gateway, you deploy and event gateway type and configure one or more event
gateway instances.
To deploy a event gateway type in ColdFusion:
1.
Compile your Gateway class and put it in a JAR file along with any other required classes.
Note: The ColdFusion MX class loader includes the gateway \lib directory on its classpath and
includes any JAR files that are in that directory on the class path.
2.
Put the JAR file in the cf_root\WEB-INF\cfusion\gateway\lib directory on J2EE configurations
or the cf_root\gateway\lib directory on server configurations. This directory is on the
ColdFusion classpath.