coldbox.system.logging.appenders

Class FileAppender

railo-context.Component
        extended by coldbox.system.logging.AbstractAppender
            extended by coldbox.system.logging.appenders.FileAppender
Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Direct Known Subclasses:
    RollingFileAppender

    This is a simple implementation of an appender that is file based.

    Constructor Summary
    init(any name, [any properties='[runtime expression]'], [any layout=''], [any levelMin='0'], [any levelMax='4'])
          Constructor.
    Method Summary
    private void append(any message)
         Append a message to a file.
    private void ensureDefaultLogDirectory()
         Ensures the log directory.
    any getlockname()
         The file Lock name.
    any getlockTimeout()
         The lock timeout.
    any getlogFullpath()
         Get the full log path used.
    void initLogLocation()
         Initialize the file log location if it does not exist.
    void logMessage(any logEvent)
         Write an entry into the appender.
    void onRegistration()
         Runs on registration.
    void removeLogFile()
         Removes the log file.
     
    Methods inherited from class coldbox.system.logging.AbstractAppender
    $log, canLog, getColdbox, getCustomLayout, getHash, getlevelMax, getlevelMin, getName, getProperties, getProperty, getUtil, hasCustomLayout, isInitialized, onUnRegistration, propertyExists, setColdbox, setInitialized, setLevelMax, setLevelMin, setProperties, setProperty, severityToString
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

    public init(any name, [any 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

    Method Detail

    append

    private void append(any message)

    Append a message to a file

    Parameters:
    message - The message to append

    ensureDefaultLogDirectory

    private void ensureDefaultLogDirectory()

    Ensures the log directory.


    getlockname

    public any getlockname()

    The file Lock name


    getlockTimeout

    public any getlockTimeout()

    The lock timeout


    getlogFullpath

    public any getlogFullpath()

    Get the full log path used.


    initLogLocation

    public void initLogLocation()

    Initialize the file log location if it does not exist.


    logMessage

    public void logMessage(any logEvent)

    Write an entry into the appender.

    Overrides:
    logMessage in class AbstractAppender
    Parameters:
    logEvent - The logging event

    onRegistration

    public void onRegistration()

    Runs on registration

    Overrides:
    onRegistration in class AbstractAppender

    removeLogFile

    public void removeLogFile()

    Removes the log file