Logger

Package: MachII.logging.loggers.CFLog
Inherits from: logging.loggers.AbstractLogger
Concrete CFLog logger implementation for Mach-II logging.

<!--- License: Copyright 2008 GreatBizTools, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright: GreatBizTools, LLC Author: Peter J. Farrell (peter@mach-ii.com) $Id: Logger.cfc 1118 2008-10-22 19:46:33Z peterfarrell $ Created version: 1.6.0 Updated version: 1.6.0 Notes: <property name="Logging" type="MachII.logging.LoggingProperty"> <parameters> <parameter name="CFLog"> <struct> <key name="type" value="MachII.logging.loggers.CFLog.Logger" /> <!-- Optional and defaults to true --> <key name="loggingEnabled" value="true|false" /> <!-- Optional and defaults to 'fatal' --> <key name="loggingLevel" value="all|trace|debug|info|warn|error|fatal|off" /> <!-- Optional and defaults to the application.log if not defined --> <key name="logFile" value="nameOfCFLogFile" /> <!-- Optional and defaults to 'false' logs messages only if CF's debug mode is enabled --> <key name="debugModeOnly" value="false" /> <!-- Optional --> <key name="filter" value="list,of,filter,criteria" /> - OR - <key name="filter"> <array> <element value="array" /> <element value="of" /> <element value="filter" /> <element value="criteria" /> </array> </key> </struct> </parameter> </parameters> </property> Uses the generic channel filter (MachII.logging.filters.GenericChannelFilter)for filtering. See that file header for configuration of filter criteria. --->

Method Summary
public void configure()

Configures the logger.

public struct getConfigurationData()

Gets the configuration data for this logger including adapter and filter.

Methods inherited from logging.loggers.AbstractLogger:   setLoggingLevel , isParameterDefined , getLoggerTypeName , setParameter , postRedirect , setLoggingEnabled , init , isMethodDefined , isPrePostRedirectAvailable , getLogAdapter , getLoggerType , isLoggingEnabled , getParameterNames , isOnRequestEndAvailable , getParameter , setParameters , setLoggerId , getParameters , preRedirect , setLogAdapter , getLoggerId , getLoggingLevel , onRequestEnd
Method Detail
configure

public void configure( )

Configures the logger.

Parameters:

Code:

	<cffunction name="configure" access="public" returntype="void" output="false"
		hint="Configures the logger.">
		
		<cfset var filter = CreateObject("component", "MachII.logging.filters.GenericChannelFilter").init(getParameter("filter", "")) />
		<cfset var adapter = CreateObject("component", "MachII.logging.adapters.CFLogAdapter").init(getParameters()) />
		
		
		<cfset adapter.setFilter(filter) />
		
		
		<cfset adapter.configure() />
		<cfset setLogAdapter(adapter) />
	</cffunction> 

getConfigurationData

public struct getConfigurationData( )

Gets the configuration data for this logger including adapter and filter.

Parameters:

Code:

	<cffunction name="getConfigurationData" access="public" returntype="struct" output="false"
		hint="Gets the configuration data for this logger including adapter and filter.">
		
		<cfset var data = StructNew() />
		
		<cfset data["Log File Name"] = getLogAdapter().getLogFile() />
		<cfset data["Logging Enabled"] = YesNoFormat(isLoggingEnabled()) />
		
		<cfreturn data />
	</cffunction>