Hi all,
I'm having trouble with the LogBox config (or rather the logbox config
struct inside coldbox.cfc). I'm running ColdBox M6 for reference.
In general the thing works fine as long as I only want logs down to
the 'info' level. When I change the "implicit level category" from
"info" to "debug" strange things happen
// change this:
info = [ "coldbox.system" ]
// to this
debug = [ "coldbox.system" ]
When I make the change above and reload the framework I get the debug
logs turning up in the trace sure enough, but the sidebar disappears
due to a javascript error 'cbox is undefined'.
I went digging to see why that might be. I ran fiddler to see what js
wasn't being called and it's this:
index.cfm?sbContent=js
When I call that URL directly it works fine and gives me JS.
When it's requested as the source attribute of the script tag it
throws a CF error (in fiddler logs) which is not caught by the
framework.
'Element ROOT is undefined in a CFML structure referenced as part of
an expression. '
which appears to originate from here:
<!--- getRootLogger --->
118 : <cffunction name="getRootLogger" output="false" access="public"
returntype="coldbox.system.logging.Logger" hint="Get the root logger">
119 : <cfreturn instance.loggerRegistry["ROOT"]>
120 : </cffunction>
Removing the implicit level category altogether results in the same
error.
If I set the implicit level category key back to 'info' all is well.
Any thoughts on why this might happen? Is the 'debug' key not valid
for that purpose? If not, how do I make the thing spit debug level
logs?
Here's my config snippet:
appenders = {
coldboxTracer = {
class="coldbox.system.logging.appenders.ColdboxTracerAppender"
},
coldboxFile = {
class="coldbox.system.logging.appenders.AsyncRollingFileAppender",
properties={
filePath = "logs",
fileName = coldbox.appname,
autoExpand = true,
fileMaxSize = 2000,
fileMaxArchives = 2
}
},
db = {
class="coldbox.system.logging.appenders.DBAppender",
properties = {
dsn = datasources.mydb.name,
table = "cblog",
autocreate = "true",
textDBType = "text"
}
}
},
// Root Logger
root = { levelmax="debug", appenders="*" },
// Implicit Level Categories
info = [ "coldbox.system" ]
};