[coldbox:4204] LogBox FUN, FUN, FUN!

Sorry Luis, I couldn’t resist with the subject line.

Ok, I’ve been having a total deja-vu night with LogBox; but instead of feeling like I’ve done something before, I keep feeling like Sean Corfield has done it before. I swear I’ve categorically hit about every question Sean went through when he dug into LogBox in early April from custom DB appenders to handle extra info, to the lack of custom layouts in the default DB appender, to the need to specify what appender to use based on severity. So thanks for cranking through all those issues Sean, you saved me the trouble of posting them all since all I had to do was read through your threads from last month to answer all my questions :slight_smile:

And for the record, I wanted to reinforce my desire to control the appender based on severity and not category. In my instance, I want LogBox to behave the same regardless of “where” in my app it is. I basically just have one simple root logger. I wish for it to use the DB appender for all severities, and the rolling log file appender only for fatal severities. Is it still a correct statement that is not possible to do without making a custom log file appender that checks the severity and ignores the ones it doesn’t like?

Would the solution for this be that a category (or the root logger) could instead of accepting a list of appender names, accept a struct that contained each appender name as well as the max and min levels for that appender/category match.
Then basically, I could have:

// Root Logger
root =
{
appenders=
{
DBAppender =
{
levelMin = “FATAL”,
levelMax = “INFO”
},
AsyncRollingFileAppender =
{
levelMin = “FATAL”,
levelMax = “FATAL”
}
}
}

Where the DBAppender kicked in for all levels where the root logger was used, but the log file appender only kicked in for FATAL levels handled by the root logger. Let me know if I’m way off – I’m still a little sketchy on some parts of the config.

Thanks!

~Brad

Hi Brad, thanks for the subject line!!
Anyways, to answer your question:

Is it still a correct statement that is not possible to do without making a custom log file appender that checks the severity and ignores the ones it doesn’t like?

No, the latest release has appender affinity, so you can choose logging levels for each individual appender.

So now you can set a levelMin and levelMax for each individual appender (All in the docs now!!!)

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com