Hi,
I am trying the features in LogBox. I create a database for logbox to write logs to.
In the config: Coldbox.cfc, I have the following setting:
logBox = {
// Define Appenders
appenders = {
dbLog = {
class=“coldbox.system.logging.appenders.DBAppender”,
properties =
{
dsn = ‘test’,
table = ‘logs’,
autocreate = true
},
levelMax = “INFO”,
levelMin = “FATAL”
}
},
root = {levelMax=“INFO”, appenders=“*”},
categories = {
“dblogger” = { levelMin=“FATAL”, levelMax= “INFO”, appenders=“dbLog” }
},
OFF = [“coldbox.system”]
};
And then I create an API as followed:
any function index( event, rc, prc ){
log.info(“hi there”);
writedump(“#log.hasAppenders() #”);
abort;
prc.response.setData( “Welcome to my ColdBox RESTFul Service” );
}
I check the database, the logs table is created successfully and the “hi there” info log is created as well.
However, the #log.hasAppenders() # shows false result. Also when I dump the appenders struct, it shows nothing.
I wonder if there is anything wrong I did about the setting of LogBox. appreciate any help. Thanks a lot!