cachebox.system.logging.config

Class LogBoxConfig

lucee.Component
    extended by cachebox.system.logging.config.LogBoxConfig

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This is a LogBox configuration object. You can use it to configure a LogBox instance.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Constructor Summary
    init([any CFCConfig], [string CFCConfigPath])
          Constructor.
    Method Summary
    LogBoxConfig appender(any name, any class, [struct properties='[runtime expression]'], [any layout=''], [any levelMin='0'], [any levelMax='4'])
         Add an appender configuration.
    LogBoxConfig category(any name, [any levelMin='0'], [any levelMax='4'], [any appenders='*'])
         Add a new category configuration with appender(s).
    boolean categoryExists(any name)
         Check if a category definition exists.
    private struct convertLevels(any target)
         Convert levels from an incoming structure of data.
    LogBoxConfig debug()
         Add categories to the DEBUG level.
    LogBoxConfig error()
         Add categories to the ERROR level.
    LogBoxConfig fatal()
         Add categories to the FATAL level.
    struct getAllAppenders()
         Get all the configured appenders.
    struct getAllCategories()
         Get the configured categories.
    struct getCategory(any name)
         Get a specified category definition.
    struct getMemento()
         Get the instance memento.
    struct getRoot()
         Get the root logger definition.
    LogBoxConfig info()
         Add categories to the INFO level.
    private any levelChecks(any levelMin, any levelMax)
         Level checks on incoming levels.
    LogBoxConfig loadDataDSL(struct rawDSL)
         Load a data configuration CFC data DSL.
    LogBoxConfig off()
         Add categories to the OFF level.
    LogBoxConfig reset()
         Reset the configuration.
    LogBoxConfig resetAppenders()
         Reset appender configuration.
    LogBoxConfig resetCategories()
         Reset categories configuration.
    LogBoxConfig resetRoot()
         Reset root configuration.
    LogBoxConfig root(any appenders, [any levelMin='0'], [any levelMax='4'])
         Add an appender configuration.
    LogBoxConfig validate()
         Validates the configuration.
    LogBoxConfig warn()
         Add categories to the WARN level.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([any CFCConfig], [string CFCConfigPath])

    Constructor

    Parameters:
    CFCConfig - The logBox Data Configuration CFC
    CFCConfigPath - The logBox Data Configuration CFC path to use

    Method Detail

    appender

    public LogBoxConfig appender(any name, any class, [struct properties='[runtime expression]'], [any layout=''], [any levelMin='0'], [any levelMax='4'])

    Add an appender configuration

    Parameters:
    name - A unique name for the appender to register. Only unique names can be registered per instance
    class - The appender's class to register. We will create, init it and register it for you
    properties - The structure of properties to configure this appender with.
    layout - The layout class path to use in this appender for custom message rendering.
    levelMin - The default log level for the root logger, by default it is 0 (FATAL). Optional. ex: config.logLevels.WARN
    levelMax - The default log level for the root logger, by default it is 4 (DEBUG). Optional. ex: config.logLevels.WARN

    category

    public LogBoxConfig category(any name, [any levelMin='0'], [any levelMax='4'], [any appenders='*'])

    Add a new category configuration with appender(s). Appenders MUST be defined first, else this method will throw an exception

    Parameters:
    name - A unique name for the appender to register. Only unique names can be registered per instance
    levelMin - The default log level for the root logger, by default it is 0 (FATAL). Optional. ex: config.logLevels.WARN
    levelMax - The default log level for the root logger, by default it is 4 (DEBUG). Optional. ex: config.logLevels.WARN
    appenders - A list of appender names to configure this category with. By default it uses all the registered appenders

    categoryExists

    public boolean categoryExists(any name)

    Check if a category definition exists

    Parameters:
    name - The category name

    convertLevels

    private struct convertLevels(any target)

    Convert levels from an incoming structure of data

    Parameters:
    target - The structure to look for elements: LevelMin and LevelMax

    debug

    public LogBoxConfig debug()

    Add categories to the DEBUG level. Send each category as an argument.


    error

    public LogBoxConfig error()

    Add categories to the ERROR level. Send each category as an argument.


    fatal

    public LogBoxConfig fatal()

    Add categories to the FATAL level. Send each category as an argument.


    getAllAppenders

    public struct getAllAppenders()

    Get all the configured appenders


    getAllCategories

    public struct getAllCategories()

    Get the configured categories


    getCategory

    public struct getCategory(any name)

    Get a specified category definition

    Parameters:
    name - The category name

    getMemento

    public struct getMemento()

    Get the instance memento


    getRoot

    public struct getRoot()

    Get the root logger definition


    info

    public LogBoxConfig info()

    Add categories to the INFO level. Send each category as an argument.


    levelChecks

    private any levelChecks(any levelMin, any levelMax)

    Level checks on incoming levels

    Parameters:
    levelMin - true
    levelMax - true
    Throws:
    InvalidLevel

    loadDataDSL

    public LogBoxConfig loadDataDSL(struct rawDSL)

    Load a data configuration CFC data DSL

    Parameters:
    rawDSL - The data configuration DSL structure

    off

    public LogBoxConfig off()

    Add categories to the OFF level. Send each category as an argument.


    reset

    public LogBoxConfig reset()

    Reset the configuration


    resetAppenders

    public LogBoxConfig resetAppenders()

    Reset appender configuration


    resetCategories

    public LogBoxConfig resetCategories()

    Reset categories configuration


    resetRoot

    public LogBoxConfig resetRoot()

    Reset root configuration


    root

    public LogBoxConfig root(any appenders, [any levelMin='0'], [any levelMax='4'])

    Add an appender configuration

    Parameters:
    appenders - A list of appenders to configure the root logger with. Send a * to add all appenders
    levelMin - The default log level for the root logger, by default it is 0 (FATAL). Optional. ex: config.logLevels.WARN
    levelMax - The default log level for the root logger, by default it is 4 (DEBUG). Optional. ex: config.logLevels.WARN
    Throws:
    InvalidAppenders

    validate

    public LogBoxConfig validate()

    Validates the configuration. If not valid, it will throw an appropriate exception.

    Throws:
    AppenderNotFound

    warn

    public LogBoxConfig warn()

    Add categories to the WARN level. Send each category as an argument.