For the complete documentation index, see llms.txt. This page is also available as Markdown.

LogBox Directive

The logbox configuration directive — how ColdBox wires LogBox into your application.

The logbox structure is based on the LogBox declaration DSL and configures logging for your application.

📖 Appenders, layouts, categories, and the full DSL live in the LogBox book: logbox.ortusbooks.com

//LogBox DSL
logBox = {
    // The configuration file without fileextension to use for operation, instead of using this structure
    configFile = "config/LogBox",
    // Appenders
    appenders = {
        appenderName = {
            class="class.to.appender",
            layout="class.to.layout",
            levelMin=0,
            levelMax=4,
            properties={
                name  = value,
                prop2 = value 2
            }
    },
    // Root Logger
    root = {levelMin="FATAL", levelMax="DEBUG", appenders="*"},
    // Granualr Categories
    categories = {
        "coldbox.system" = { levelMin="FATAL", levelMax="INFO", appenders="*"},
        "model.security" = { levelMax="DEBUG", appenders="console"}
    }
    // Implicit categories
    debug  = ["coldbox.system.interceptors"],
    info   = ["model.class", "model2.class2"],
    warn   = ["model.class", "model2.class2"],
    error  = ["model.class", "model2.class2"],
    fatal  = ["model.class", "model2.class2"],
    off    = ["model.class", "model2.class2"]
};

Info : If you do not define a logBox DSL structure, the framework will look for the default configuration file config/LogBox.bx (or .cfc for CFML). If it does not find it, then it will use the framework's default logging settings.

ConfigFile

You can use a configuration class instead of inline configuration by using this setting. The default value is config/LogBox.bx (or .cfc for CFML), so by convention you can just use that location. If no values are defined or no config file exists, the framework uses its shipped default configuration at /coldbox/system/web/config/LogBox.cfc.

Last updated

Was this helpful?