coldbox.system.logging

Class AbstractAppender

railo-context.Component
        extended by coldbox.system.logging.AbstractAppender
Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Direct Known Subclasses:
    CFAppender , ConsoleAppender , DBAppender , DummyAppender , EmailAppender , FileAppender , ScopeAppender , SocketAppender , TracerAppender

    This is the abstract interface component for all LogBox Appenders

    Constructor Summary
    init(any name, [any<struct> properties='[runtime expression]'], [any layout=''], [any<numeric> levelMin='0'], [any<numeric> levelMax='4'])
          Constructor called by a Concrete Appender.
    Method Summary
    private void $log(any severity='INFO', any message='')
         Log an internal message to the ColdFusion facilities.
    any<Boolean> canLog(any<numeric> level)
         Checks wether a log can be made on this appender using a passed in level.
    any getColdbox()
         Get the ColdBox application controller LogBox is linked to.
    any getCustomLayout()
         Get the custom layout object.
    any getHash()
         Get this appender's unique ID.
    any<numeric> getlevelMax()
         Get the level Max setting.
    any<numeric> getlevelMin()
         Get the level min setting.
    any getName()
         Get this appender's name.
    any<struct> getProperties()
         Get properties structure map.
    any getProperty(any property)
         Get a property, throws exception if not found.
    private any getUtil()
         Create and return a util object.
    any<Boolean> hasCustomLayout()
         Whether a custom layout has been set or not.
    any<Boolean> isInitialized()
         Checks if the appender's internal variables are initialized.
    void logMessage(LogEvent logEvent)
         Write an entry into the appender.
    void onRegistration()
         Runs after the appender has been created and registered.
    void onUnRegistration()
         Runs before the appender is unregistered from LogBox.
    any<Boolean> propertyExists(any property)
         Checks wether a given property exists or not.
    void setColdbox(any coldbox)
         Set the ColdBox application link.
    void setInitialized(any initialized)
         Set's the appender's internal variables flag to initalized.
    void setLevelMax(any levelMax)
         Set the appender's default levelMax.
    void setLevelMin(any levelMin)
         Set the appender's default levelMin.
    void setProperties(any<struct> properties)
         Set the entire properties structure map.
    void setProperty(any property, any value)
         Set a property.
    any severityToString(any<numeric> severity)
         convert a severity to a string.
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

    public init(any name, [any<struct> properties='[runtime expression]'], [any layout=''], [any<numeric> levelMin='0'], [any<numeric> levelMax='4'])

    Constructor called by a Concrete Appender

    Parameters:
    name - The unique name for this appender.
    properties - A map of configuration properties for the appender
    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 5. Optional. ex: LogBox.logLevels.WARN

    Method Detail

    $log

    private void $log(any severity='INFO', any message='')

    Log an internal message to the ColdFusion facilities. Used when errors ocurrs or diagnostics

    Parameters:
    severity - The severity to use.
    message - The message to log

    canLog

    public any<Boolean> canLog(any<numeric> level)

    Checks wether a log can be made on this appender using a passed in level

    Parameters:
    level - The level to check if it can be logged in this Appender

    getColdbox

    public any getColdbox()

    Get the ColdBox application controller LogBox is linked to. If not set, it will return an empty string.


    getCustomLayout

    public any getCustomLayout()

    Get the custom layout object


    getHash

    public any getHash()

    Get this appender's unique ID


    getlevelMax

    public any<numeric> getlevelMax()

    Get the level Max setting


    getlevelMin

    public any<numeric> getlevelMin()

    Get the level min setting


    getName

    public any getName()

    Get this appender's name


    getProperties

    public any<struct> getProperties()

    Get properties structure map


    getProperty

    public any getProperty(any property)

    Get a property, throws exception if not found.

    Parameters:
    property - The key of the property to return.

    getUtil

    private any getUtil()

    Create and return a util object


    hasCustomLayout

    public any<Boolean> hasCustomLayout()

    Whether a custom layout has been set or not.


    isInitialized

    public any<Boolean> isInitialized()

    Checks if the appender's internal variables are initialized.


    logMessage

    public void logMessage(LogEvent logEvent)

    Write an entry into the appender. You must implement this method yourself.

    Parameters:
    logEvent - The logging event to log.

    onRegistration

    public void onRegistration()

    Runs after the appender has been created and registered. Implemented by Concrete appender


    onUnRegistration

    public void onUnRegistration()

    Runs before the appender is unregistered from LogBox. Implemented by Concrete appender


    propertyExists

    public any<Boolean> propertyExists(any property)

    Checks wether a given property exists or not.

    Parameters:
    property - The property name

    setColdbox

    public void setColdbox(any coldbox)

    Set the ColdBox application link

    Parameters:
    coldbox

    setInitialized

    public void setInitialized(any initialized)

    Set's the appender's internal variables flag to initalized.

    Parameters:
    initialized

    setLevelMax

    public void setLevelMax(any levelMax)

    Set the appender's default levelMax

    Parameters:
    levelMax

    setLevelMin

    public void setLevelMin(any levelMin)

    Set the appender's default levelMin

    Parameters:
    levelMin

    setProperties

    public void setProperties(any<struct> properties)

    Set the entire properties structure map

    Parameters:
    properties

    setProperty

    public void setProperty(any property, any value)

    Set a property

    Parameters:
    property - The property name to set.
    value - The value of the property.

    severityToString

    public any severityToString(any<numeric> severity)

    convert a severity to a string

    Parameters:
    severity - The numeric severity to convert