ColdFusion 9.0 Resources |
getLoggerDescriptionReturns a ColdFusion Logger object that the event gateway can use to log information in a file. Parameters
UsageThe Logger class has five methods: debug, info, warn, error, and fatal, that correspond to the 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 writes the exception information in the exceptions.log file. ExampleThe ColdFusion 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); . . . |