coldbox.system.logging.config

Class LogBoxConfig

railo-context.Component
        extended by coldbox.system.logging.config.LogBoxConfig
Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  

    This is a LogBox configuration object. You can use it to configure a log box instance

    Constructor Summary
    init([any CFCConfig], [any CFCConfigPath])
          Constructor.
    Method Summary
    any appender(any name, any class, [any<struct> properties='[runtime expression]'], [any layout=''], [any levelMin='0'], [any levelMax='4'])
         Add an appender configuration.
    any category(any name, [any levelMin='0'], [any levelMax='4'], [any appenders='*'])
         Add a new category configuration with appender(s).
    any<boolean> categoryExists(any name)
         Check if a category definition exists.
    private any<struct> convertLevels(any<struct> target='')
         Convert levels from an incoming structure of data.
    any DEBUG()
         Add categories to the DEBUG level.
    any ERROR()
         Add categories to the ERROR level.
    any FATAL()
         Add categories to the FATAL level.
    any<struct> getAllAppenders()
         Get all the configured appenders.
    any<struct> getAllCategories()
         Get the configured categories.
    any<struct> getCategory(any name)
         Get a specifed category definition.
    any<struct> getMemento()
         Get the instance data.
    any<struct> getRoot()
         Get the root logger definition.
    any INFO()
         Add categories to the INFO level.
    private void levelChecks(any levelMin, any levelMax)
         Level checks or throw.
    void loadDataDSL(any<struct> rawDSL)
         Load a data configuration CFC data DSL.
    any OFF()
         Add categories to the OFF level.
    void reset()
         Reset the configuration.
    void resetAppenders()
         Reset the appender configurations.
    void resetCategories()
         Reset the set categories.
    void resetRoot()
         Reset the root logger.
    any root([any levelMin='0'], [any levelMax='4'], any appenders)
         Register the root logger in this configuration.
    void validate()
         Validates the configuration.
    any WARN()
         Add categories to the WARN level.
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

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

    Constructor

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

    Method Detail

    appender

    public any appender(any name, any class, [any<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 any 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 min log level for this category. Defaults to the lowest level 0 or FATAL
    levelMax - The max default log level for this category. If not passed it defaults to the highest level possible
    appenders - A list of appender names to configure this category with. By default it uses all the registered appenders

    categoryExists

    public any<boolean> categoryExists(any name)

    Check if a category definition exists

    Parameters:
    name - The category to retrieve

    convertLevels

    private any<struct> convertLevels(any<struct> target='')

    Convert levels from an incoming structure of data

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

    DEBUG

    public any DEBUG()

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


    ERROR

    public any ERROR()

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


    FATAL

    public any FATAL()

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


    getAllAppenders

    public any<struct> getAllAppenders()

    Get all the configured appenders


    getAllCategories

    public any<struct> getAllCategories()

    Get the configured categories


    getCategory

    public any<struct> getCategory(any name)

    Get a specifed category definition

    Parameters:
    name - The category to retrieve

    getMemento

    public any<struct> getMemento()

    Get the instance data


    getRoot

    public any<struct> getRoot()

    Get the root logger definition.


    INFO

    public any INFO()

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


    levelChecks

    private void levelChecks(any levelMin, any levelMax)

    Level checks or throw

    Parameters:
    levelMin
    levelMax

    loadDataDSL

    public void loadDataDSL(any<struct> rawDSL)

    Load a data configuration CFC data DSL

    Parameters:
    rawDSL - The data configuration DSL structure

    OFF

    public any OFF()

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


    reset

    public void reset()

    Reset the configuration


    resetAppenders

    public void resetAppenders()

    Reset the appender configurations


    resetCategories

    public void resetCategories()

    Reset the set categories


    resetRoot

    public void resetRoot()

    Reset the root logger


    root

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

    Register the root logger in this configuration.

    Parameters:
    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 appenders to configure the root logger with. Send a * to add all appenders

    validate

    public void validate()

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


    WARN

    public any WARN()

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