logbox.system.logging

Class LogBox

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

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This is LogBox, an enterprise logging library. Please remember to persist this class once it has been created. You can create as many instances of LogBox as you like. Just remember that you need to register loggers in it. It can be one or 1000, it all depends on you. By default, LogBox will log any warnings pertaining to itself in the CF logs according to its name.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    struct appenderRegistry
          The appender registration map.

    • access = public
    • returntype = any
    true false
    any categoryAppenders
          Category based appenders.

    • access = public
    • returntype = any
    true false
    any coldbox
          ColdBox linkage class.

    • access = public
    • returntype = any
    true false
    any config
          Configuration object.

    • access = public
    • returntype = any
    true false
    any logBoxID
          The LogBox unique ID.

    • access = public
    • returntype = any
    true false
    struct loggerRegistry
          The Logger registration map.

    • access = public
    • returntype = any
    true false
    any version
          The LogBox operating version.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(LogBoxConfig config, [any coldbox=''])
          Constructor.
    Method Summary
    any configure(any<LogBoxConfig> config)
         Configure logbox for operation.
    string getAppenderRegistry()
    struct getAppendersMap(any appenders)
         Get a map of appenders by list.
    string getCategoryAppenders()
    string getColdbox()
    string getConfig()
    string getCurrentAppenders()
         Get the list of currently instantiated appenders.
    string getCurrentLoggers()
         Get the list of currently instantiated loggers.
    string getLogBoxID()
    any getLogger(any category)
         Get a logger object configured with a category name and appenders.
    string getLoggerRegistry()
    any getRootLogger()
         Get the root logger object.
    private any getUtil()
         Get Utility Object.
    string getVersion()
    private any locateCategoryParentLogger(any category)
         Get a parent logger according to category convention inheritance.
    any registerAppender(any name, any class, [struct properties='[runtime expression]'], [any layout=''], [numeric levelMin='0'], [numeric levelMax='4'])
         Register a new appender object in the appender registry.
    any setAppenderRegistry(struct appenderRegistry)
    any setCategoryAppenders(any categoryAppenders)
    any setColdbox(any coldbox)
    any setConfig(any config)
    any setLogBoxID(any logBoxID)
    any setLoggerRegistry(struct loggerRegistry)
    any setVersion(any version)
     
    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.

    Property Detail

    appenderRegistry

    property struct appenderRegistry

    The appender registration map

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    categoryAppenders

    property any categoryAppenders

    Category based appenders

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    coldbox

    property any coldbox

    ColdBox linkage class

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    config

    property any config

    Configuration object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    logBoxID

    property any logBoxID

    The LogBox unique ID

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    loggerRegistry

    property struct loggerRegistry

    The Logger registration map

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    version

    property any version

    The LogBox operating version

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    configure

    public any configure(any<LogBoxConfig> 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: logbox.system.logging.config.LogBoxConfig

    getAppenderRegistry

    public string getAppenderRegistry()


    getAppendersMap

    public struct 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

    getCategoryAppenders

    public string getCategoryAppenders()


    getColdbox

    public string getColdbox()


    getConfig

    public string getConfig()


    getCurrentAppenders

    public string getCurrentAppenders()

    Get the list of currently instantiated appenders.


    getCurrentLoggers

    public string getCurrentLoggers()

    Get the list of currently instantiated loggers.


    getLogBoxID

    public string getLogBoxID()


    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
    Returns:
    logbox.system.logging.Logger

    getLoggerRegistry

    public string getLoggerRegistry()


    getRootLogger

    public any getRootLogger()

    Get the root logger object

    Returns:
    logbox.system.logging.Logger

    getUtil

    private any getUtil()

    Get Utility Object


    getVersion

    public string getVersion()


    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, [struct properties='[runtime expression]'], [any layout=''], [numeric levelMin='0'], [numeric 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 variables.
    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

    setAppenderRegistry

    public any setAppenderRegistry(struct appenderRegistry)

    Parameters:
    appenderRegistry

    setCategoryAppenders

    public any setCategoryAppenders(any categoryAppenders)

    Parameters:
    categoryAppenders

    setColdbox

    public any setColdbox(any coldbox)

    Parameters:
    coldbox

    setConfig

    public any setConfig(any config)

    Parameters:
    config

    setLogBoxID

    public any setLogBoxID(any logBoxID)

    Parameters:
    logBoxID

    setLoggerRegistry

    public any setLoggerRegistry(struct loggerRegistry)

    Parameters:
    loggerRegistry

    setVersion

    public any setVersion(any version)

    Parameters:
    version