Hi, I’m trying to configure the coldboxTracerAppender adding it to a logger category in my configuration so when I inject it into a handler I can write for example:
property name="log" inject="logbox:logger:Tracer"
This is my configuration struct:
`
//LogBox DSL
logBox = {
// Define Appenders
appenders = {
consoleLog = { class=“coldbox.system.logging.appenders.ConsoleAppender” },
fileLog = {
class=‘coldbox.system.logging.appenders.RollingFileAppender’,
properties={
filePath = ‘/logs’,
fileName = ‘bitacora’,
autoExpand = true,
fileMaxSize = 2000,
fileMaxArchives = 3
}
},
tracer = {
class=‘modules.cbdebugger.includes.appenders.ColdBoxTracerAppender’,
properties={}
}
},
// Root Logger
root = { levelmax=“INFO”, appenders=“consoleLog” },
categories = {
Seguridad = { levelmin=“ERROR”, levelmax=“INFO”, appenders=“fileLog” },
Tracer = { levelmin=“DEBUG”, appenders=“tracer” }
},
// Implicit Level Categories
//info = [ “coldbox.system” ],
OFF = [“coldbox.system”]
};
`
It has an appender named “tracer” which points to modules.cbdebugger.includes.appenders.ColdBoxTracerAppender
and a logger named “Tracer” which includes the tracer appender, with this configuration if I do this
log.debug('My message', myStruct );
Coldbox should send the message to the Coldbox Tracer and see it in the debugger panel but instead I get this error
Element BINDER is undefined in a Java object of type class [Ljava.lang.String;.
The error occurred in /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/ioc/Injector.cfc: line 222
Called from /Applications/ColdFusion9/wwwroot/sofom4/modules/cbdebugger/includes/appenders/ColdBoxTracerAppender.cfc: line 34
Called from /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/logging/LogBox.cfc: line 211
Called from /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/logging/LogBox.cfc: line 86
Called from /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/web/services/LoaderService.cfc: line 38
Called from /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/Bootstrap.cfc: line 71
Called from /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/Bootstrap.cfc: line 107
Called from /Applications/ColdFusion9/wwwroot/sofom4/coldbox/system/Bootstrap.cfc: line 350
Called from /Applications/ColdFusion9/wwwroot/sofom4/Application.cfc: line 88
220 :
221 : // Check if Mapping Exists?
222 : if( NOT instance.binder.mappingExists(arguments.name) ){
223 : // No Mapping exists, let’s try to locate it first. We are now dealing with request by conventions
224 : instancePath = locateInstance(arguments.name);
I see that line 34 of the ColdBoxTracerAppender gets the debuggerService
<cfset variables.debuggerService = getColdBox().getWireBox().getInstance( "debuggerService@cbdebugger" )>
But it seems like wirebox doesn’t find the mapping, so I removed the appender from the logbox config structure and the app ran normally.
However I know that wirebox can find that mapping because I can inject the service in my handler
property name="debuggerService" inject="debuggerService@cbdebugger";
or like this
debuggerService = wirebox.getInstance(‘debuggerService@cbdebugger’);
And add some message to the tracer
debuggerService.pushTracer('This is my message', myStruct );
To finally achieve my goal, but what am I doing wrong with the appender?
Thanks in advance,
Angel Chrystian