coldbox.system.logging

Class Logger

railo-context.Component
        extended by coldbox.system.logging.Logger
Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  

    This is a logging object that allows for all kinds of logging to occur within its appenders

    Constructor Summary
    init(any category, [any<numeric> levelMin='0'], [any<numeric> levelMax='4'], [any<struct> appenders='[runtime expression]'])
          Create a new logger object.
    Method Summary
    void addAppender(any<AbstractAppender> newAppender='')
         Add a new appender to the list of appenders for this logger.
    any<Boolean> appenderExists(any name)
         Checks to see if a specified appender exists by name.
    any<Boolean> canDebug()
         Can log debug messages.
    any<Boolean> canError()
         Can log error messages.
    any<Boolean> canFatal()
         Can log fatal messages.
    any<Boolean> canInfo()
         Can log info messages.
    any<Boolean> canLog(any<numeric> level)
         Checks wether a log can be made on this Logger using a passed in level.
    any<Boolean> canWarn()
         Can log warn messages.
    void debug(any message, [any extraInfo=''])
         I log a debug message.
    void error(any message, [any extraInfo=''])
         I log an error message.
    void fatal(any message, [any extraInfo=''])
         I log a fatal message.
    any getAppender(any name)
         Get a named appender from this logger class.
    any<struct> getAppenders()
         Get all the registered appenders for this logger.
    any getCategory()
         Get the configured category for this logger.
    any<Boolean> getlevelMax()
         Get the level Max setting.
    any<numeric> getlevelMin()
         Get the level min setting.
    any<Logger> getRootLogger()
         Get the root logger.
    any<boolean> hasAppenders()
         Checks to see if we have registered any appenders yet.
    void info(any message, [any extraInfo=''])
         I log an information message.
    void logMessage(any message, any<numeric> severity, [any extraInfo=''])
         Write an entry into the loggers registered with this LogBox instance.
    void removeAllAppenders()
         Removes all appenders registered.
    any<Boolean> removeAppender(any name)
         Unregister an appender from this Logger.
    void setCategory(any category)
         Set the category for this logger.
    void setLevelMax(any levelMax)
         Set the appender's default levelMax.
    void setLevelMin(any levelMin)
         Set the appender's default levelMin.
    void setRootLogger(any<Logger> RootLogger)
         Set the root logger for this named logger.
    void warn(any message, [any extraInfo=''])
         I log a warning message.
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

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

    Create a new logger object.

    Parameters:
    category - The category name to use this logger with
    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
    appenders - A struct of already created appenders for this category, or blank to use the root logger.

    Method Detail

    addAppender

    public void addAppender(any<AbstractAppender> newAppender='')

    Add a new appender to the list of appenders for this logger. If the appender already exists, then it will not be added.

    Parameters:
    newAppender - The new appender to add to this logger programmatically.

    appenderExists

    public any<Boolean> appenderExists(any name)

    Checks to see if a specified appender exists by name.

    Parameters:
    name - The name of the appender to check if it is registered

    canDebug

    public any<Boolean> canDebug()

    Can log debug messages


    canError

    public any<Boolean> canError()

    Can log error messages


    canFatal

    public any<Boolean> canFatal()

    Can log fatal messages


    canInfo

    public any<Boolean> canInfo()

    Can log info messages


    canLog

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

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

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

    canWarn

    public any<Boolean> canWarn()

    Can log warn messages


    debug

    public void debug(any message, [any extraInfo=''])

    I log a debug message.

    Parameters:
    message - The message to log.
    extraInfo - Extra information to send to the loggers.

    error

    public void error(any message, [any extraInfo=''])

    I log an error message.

    Parameters:
    message - The message to log.
    extraInfo - Extra information to send to the loggers.

    fatal

    public void fatal(any message, [any extraInfo=''])

    I log a fatal message.

    Parameters:
    message - The message to log.
    extraInfo - Extra information to send to the loggers.

    getAppender

    public any getAppender(any name)

    Get a named appender from this logger class. If the appender does not exists, it will throw an exception.

    Parameters:
    name - The appender's name

    getAppenders

    public any<struct> getAppenders()

    Get all the registered appenders for this logger.


    getCategory

    public any getCategory()

    Get the configured category for this logger


    getlevelMax

    public any<Boolean> getlevelMax()

    Get the level Max setting


    getlevelMin

    public any<numeric> getlevelMin()

    Get the level min setting


    getRootLogger

    public any<Logger> getRootLogger()

    Get the root logger


    hasAppenders

    public any<boolean> hasAppenders()

    Checks to see if we have registered any appenders yet


    info

    public void info(any message, [any extraInfo=''])

    I log an information message.

    Parameters:
    message - The message to log.
    extraInfo - Extra information to send to the loggers.

    logMessage

    public void logMessage(any message, any<numeric> severity, [any extraInfo=''])

    Write an entry into the loggers registered with this LogBox instance.

    Parameters:
    message - The message to log.
    severity - The severity level to log, if invalid, it will default to INFO
    extraInfo - Extra information to send to the loggers.

    removeAllAppenders

    public void removeAllAppenders()

    Removes all appenders registered


    removeAppender

    public any<Boolean> removeAppender(any name)

    Unregister an appender from this Logger. True if successful or false otherwise.

    Parameters:
    name - The name of the appender to unregister

    setCategory

    public void setCategory(any category)

    Set the category for this logger

    Parameters:
    category

    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

    setRootLogger

    public void setRootLogger(any<Logger> RootLogger)

    Set the root logger for this named logger.

    Parameters:
    RootLogger

    warn

    public void warn(any message, [any extraInfo=''])

    I log a warning message.

    Parameters:
    message - The message to log.
    extraInfo - Extra information to send to the loggers.