coldbox.system.logging

Class LogBox

lucee.Component
    extended by coldbox.system.logging.LogBox

This is LogBox, an enterprise logger. Please remember to persist this factory once it has been created.

Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Constructor Summary
    init(LogBoxConfig config, [any coldbox=''])
          Constructor.
    Method Summary
    void configure(any config)
         Configure logbox for operation.
    any getAppendersMap(any appenders)
         Get a map of appenders by list.
    any getConfig()
         Get this LogBox's configuration object.
    any getCurrentAppenders()
         Get the list of currently registered appenders.
    any getCurrentLoggers()
         Get the list of currently instantiated loggers.
    any getLogger(any category)
         Get a logger object configured with a category name and appenders.
    any getRootLogger()
         Get the root logger.
    private any getUtil()
         Create and return a util object.
    any getVersion()
         Get the LogBox version string.
    private any locateCategoryParentLogger(any category)
         Get a parent logger according to category convention inheritance.
    any registerAppender(any name, any class, [any properties='[runtime expression]'], [any layout=''], [any levelMin='0'], [any levelMax='4'])
         Register a new appender object in the appender registry.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(LogBoxConfig config, [any coldbox=''])

    Constructor

    Parameters:
    config - The LogBoxConfig object to use to configure this instance of LogBox
    coldbox - A coldbox application that this instance of logbox can be linked to.

    Method Detail

    configure

    public void configure(any config)

    Configure logbox for operation. You can also re-configure LogBox programmatically. Basically we register all appenders here and all categories

    Parameters:
    config - The LogBoxConfig object to use to configure this instance of LogBox: coldbox.system.logging.config.LogBoxConfig

    getAppendersMap

    public any getAppendersMap(any appenders)

    Get a map of appenders by list. Usually called to get a category of appenders.

    Parameters:
    appenders - The list of appenders to get

    getConfig

    public any getConfig()

    Get this LogBox's configuration object.


    getCurrentAppenders

    public any getCurrentAppenders()

    Get the list of currently registered appenders.


    getCurrentLoggers

    public any getCurrentLoggers()

    Get the list of currently instantiated loggers.


    getLogger

    public any getLogger(any category)

    Get a logger object configured with a category name and appenders. If not configured, then it reverts to the root logger defined for this instance of LogBox

    Parameters:
    category - The category name to use in this logger or pass in the target object will log from and we will inspect the object and use its metadata name.

    getRootLogger

    public any getRootLogger()

    Get the root logger


    getUtil

    private any getUtil()

    Create and return a util object


    getVersion

    public any getVersion()

    Get the LogBox version string.


    locateCategoryParentLogger

    private any locateCategoryParentLogger(any category)

    Get a parent logger according to category convention inheritance. If not found, it returns the root logger.

    Parameters:
    category - The category name to investigate for parents.

    registerAppender

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

    Register a new appender object in the appender registry.

    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 to use in this appender for custom message rendering.
    levelMin - The default log level for this appender, by default it is 0. Optional. ex: LogBox.logLevels.WARN
    levelMax - The default log level for this appender, by default it is 4. Optional. ex: LogBox.logLevels.WARN