Logbox integration - Per Environment

Hi folks,

In my ColdBox config file I am using per-environment settings to override/modify settings in staging and development

For my default production settings I want to use the LogBox DB appender

//LogBox DSL - DB Appender
logBox = {
// Define Appenders
appenders = {
coldboxTracer = { class=“coldbox.system.logging.appenders.ColdboxTracerAppender” },
// DB appender so we can see the logbox log reader work
dbAppender = {
class=“coldbox.system.logging.appenders.DBAppender”,
properties = {
dsn = “relax”, table=“api_logs”, autocreate=false, textDBType=“text”
}
}
},
// Root Logger
root = { levelmax=“DEBUG”, appenders="*" },
// Implicit Level Categories
info = [ “coldbox.system” ]
};

However, in both staging and development I also run to the file appender. If I set this up like so, will both the DB appender and file appender run? Or would I need to re-declare the DB appender in the development() function?

void function development(){

//Logbog - File Appender
logBox = {
appenders = {
coldboxTracer = {class=“coldbox.system.logging.appenders.ColdboxTracerAppender”},
fileLog = {
class=“coldbox.system.logging.appenders.AsyncRollingFileAppender”,
properties={
filePath = “logs”,
fileName = coldbox.appName,
autoExpand = true,
fileMaxSize = 2000,
fileMaxArchives = 3
}
}

},
root = {levelMax=“DEBUG”, appenders="*"}
};

}

Thanks.

Nolan

well, in the dev function you are completely overriding the logbox structure.

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

I thought so.

Is it possible to append my appender in dev? :wink:

i.e just add the file appender into already declared logbox db appender so that both will run in dev? I’m being lazy… don’t want to re-declare the db appender settings if I don’t have to :slight_smile:

Thanks.

N

Config.logbox.appenders = {}

Regards,

Andrew Scott

http://www.andyscott.id.au/

Sorry I mean to type coldbox not config.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Great. Thanks Andrew!

Nolan