logbox.system.logging

Class AbstractAppender

lucee.Component
    extended by logbox.system.logging.AbstractAppender
Direct Known Subclasses:
CFAppender , ConsoleAppender , DBAppender , DummyAppender , EmailAppender , FileAppender , ScopeAppender , SocketAppender , TracerAppender

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This component is used as a base for creating LogBox appenders

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any coldbox
          ColdBox Controller Linkage, empty if in standalone mode.

    • access = public
    • returntype = any
    true false
    any customLayout
          Appender customLayout for rendering messages.

    • access = public
    • returntype = any
    true false
    boolean initialized
          Appender initialized flag.

    • access = public
    • returntype = any
    false true false
    numeric levelMax
          Max logging level.

    • access = public
    • returntype = any
    true false
    numeric levelMin
          Min logging level.

    • access = public
    • returntype = any
    true false
    any name
          Appender name.

    • access = public
    • returntype = any
    true false
    struct properties
          Appender properties.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any name, [struct properties='[runtime expression]'], [any layout=''], [any levelMin='0'], [any levelMax='4'])
          Constructor.
    Method Summary
    private AbstractAppender $log(any severity, any message)
         Facade to internal ColdFusion logging facilities, just in case.
    boolean canLog(numeric level)
         Checks wether a log can be made on this appender using a passed in level.
    string getColdbox()
    string getCustomLayout()
    any getHash()
         Get internal hash id.
    string getInitialized()
    string getLevelMax()
    string getLevelMin()
    string getName()
    string getProperties()
    any getProperty(any property)
         Get a property from the `properties` struct.
    private any getUtil()
         Get the ColdBox Utility object.
    boolean hasCustomLayout()
         Verify if we have a custom layout object linked.
    boolean isInitialized()
         Is appender initialized.
    AbstractAppender logMessage(LogEvent logEvent)
         Write an entry into the appender.
    AbstractAppender onRegistration()
         Runs after the appender has been created and registered.
    AbstractAppender onUnRegistration()
         Runs before the appender is unregistered from LogBox.
    private any out(any message, [boolean addNewLine='true'])
         Utiliy to send to output to console.
    boolean propertyExists(any property)
         Validate a property from the `properties` struct.
    any setColdbox(any coldbox)
    any setCustomLayout(any customLayout)
    any setInitialized(boolean initialized)
    AbstractAppender setLevelMax(any levelMax)
         Setter for level max.
    AbstractAppender setLevelMin(any levelMin)
         Setter for level min.
    any setName(any name)
    any setProperties(struct properties)
    AbstractAppender setProperty(any property, any value)
         Set a property from the `properties` struct.
    any severityToString(numeric severity)
         convert a severity to a string.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

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

    Constructor

    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

    Property Detail

    coldbox

    property any coldbox

    ColdBox Controller Linkage, empty if in standalone mode.

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

    customLayout

    property any customLayout

    Appender customLayout for rendering messages

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

    initialized

    property boolean initialized = [false]

    Appender initialized flag

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

    levelMax

    property numeric levelMax

    Max logging level

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

    levelMin

    property numeric levelMin

    Min logging level

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

    name

    property any name

    Appender name

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

    properties

    property struct properties

    Appender properties

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

    Method Detail

    $log

    private AbstractAppender $log(any severity, any message)

    Facade to internal ColdFusion logging facilities, just in case.

    Parameters:
    severity
    message

    canLog

    public boolean canLog(numeric level)

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

    Parameters:
    level - The level to check

    getColdbox

    public string getColdbox()


    getCustomLayout

    public string getCustomLayout()


    getHash

    public any getHash()

    Get internal hash id


    getInitialized

    public string getInitialized()


    getLevelMax

    public string getLevelMax()


    getLevelMin

    public string getLevelMin()


    getName

    public string getName()


    getProperties

    public string getProperties()


    getProperty

    public any getProperty(any property)

    Get a property from the `properties` struct

    Parameters:
    property - The property key

    getUtil

    private any getUtil()

    Get the ColdBox Utility object


    hasCustomLayout

    public boolean hasCustomLayout()

    Verify if we have a custom layout object linked


    isInitialized

    public boolean isInitialized()

    Is appender initialized


    logMessage

    public AbstractAppender logMessage(LogEvent logEvent)

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

    Parameters:
    logEvent - The logging event to log

    onRegistration

    public AbstractAppender onRegistration()

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


    onUnRegistration

    public AbstractAppender onUnRegistration()

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


    out

    private any out(any message, [boolean addNewLine='true'])

    Utiliy to send to output to console.

    Parameters:
    message - Message to send
    addNewLine - Add a line break or not, default is yes

    propertyExists

    public boolean propertyExists(any property)

    Validate a property from the `properties` struct

    Parameters:
    property - The property key

    setColdbox

    public any setColdbox(any coldbox)

    Parameters:
    coldbox

    setCustomLayout

    public any setCustomLayout(any customLayout)

    Parameters:
    customLayout

    setInitialized

    public any setInitialized(boolean initialized)

    Parameters:
    initialized

    setLevelMax

    public AbstractAppender setLevelMax(any levelMax)

    Setter for level max

    Parameters:
    levelMax
    Throws:
    AbstractAppender.InvalidLogLevelException

    setLevelMin

    public AbstractAppender setLevelMin(any levelMin)

    Setter for level min

    Parameters:
    levelMin
    Throws:
    AbstractAppender.InvalidLogLevelException

    setName

    public any setName(any name)

    Parameters:
    name

    setProperties

    public any setProperties(struct properties)

    Parameters:
    properties

    setProperty

    public AbstractAppender setProperty(any property, any value)

    Set a property from the `properties` struct

    Parameters:
    property - The property key
    value - The value of the property

    severityToString

    public any severityToString(numeric severity)

    convert a severity to a string

    Parameters:
    severity - The severity to convert to a string