Rio Project 4.2 API Documentation



org.rioproject.log
Class LoggerConfig

java.lang.Object
  extended by org.rioproject.log.LoggerConfig
All Implemented Interfaces:
Serializable

public class LoggerConfig
extends Object
implements Serializable

The LoggerConfig class has been provided for dynamic services to specify Logger attributes (Level, Handler, etc...) and have the attributes established without depending on machine resident logger.properties configuration attributes to be set.

Author:
Dennis Reedy
See Also:
Serialized Form

Nested Class Summary
static class LoggerConfig.FormalArgument
          Provide a way to pass parameter lists around.
static class LoggerConfig.LogHandlerConfig
          LogerHandlerConfig provides attributes needed to create a Handler
 
Constructor Summary
LoggerConfig(String loggerName, Level level)
          Create a LoggerConfig, send logging output to its parent's handlers, with no resource bundle
LoggerConfig(String loggerName, Level level, boolean useParentHandlers, LoggerConfig.LogHandlerConfig... logHandlerConfigs)
          Create a LoggerConfig with no resource bundle
LoggerConfig(String loggerName, Level level, boolean useParentHandlers, String resourceBundleName, LoggerConfig.LogHandlerConfig... logHandlerConfigs)
          Create a LoggerConfig
LoggerConfig(String loggerName, Level level, LoggerConfig.LogHandlerConfig... logHandlerConfigs)
          Create a LoggerConfig, send logging output to its parent's handlers, with no resource bundle
 
Method Summary
 boolean equals(Object obj)
          Override equals
 Logger getLogger()
          Get the Logger, configured with attributes
 Level getLoggerLevel()
           
 String getLoggerName()
           
 int hashCode()
          Override hashCode
static boolean isNewLogger(LoggerConfig lConf, LoggerConfig[] loggerConfigs)
          Determine if the current Logger is a new Logger
static boolean levelChanged(LoggerConfig lConf, LoggerConfig[] loggerConfigs)
          Determine if the LoggerConfig provides a Level change
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoggerConfig

public LoggerConfig(String loggerName,
                    Level level)
Create a LoggerConfig, send logging output to its parent's handlers, with no resource bundle

Parameters:
loggerName - The Logger name
level - Set the log level specifying which message levels will be logged by the logger

LoggerConfig

public LoggerConfig(String loggerName,
                    Level level,
                    LoggerConfig.LogHandlerConfig... logHandlerConfigs)
Create a LoggerConfig, send logging output to its parent's handlers, with no resource bundle

Parameters:
loggerName - The Logger name
level - Set the log level specifying which message levels will be logged by the logger
logHandlerConfigs - An Array of LogHandlerConfig instances

LoggerConfig

public LoggerConfig(String loggerName,
                    Level level,
                    boolean useParentHandlers,
                    LoggerConfig.LogHandlerConfig... logHandlerConfigs)
Create a LoggerConfig with no resource bundle

Parameters:
loggerName - The Logger name
level - Set the log level specifying which message levels will be logged by the logger
useParentHandlers - Specify whether or not this logger should send its output to it's parent Logger. This means that any LogRecords will also be written to the parent's Handlers, and potentially to its parent, recursively up the namespace
logHandlerConfigs - An Array of LogHandlerConfig instances

LoggerConfig

public LoggerConfig(String loggerName,
                    Level level,
                    boolean useParentHandlers,
                    String resourceBundleName,
                    LoggerConfig.LogHandlerConfig... logHandlerConfigs)
Create a LoggerConfig

Parameters:
loggerName - The Logger name
level - Set the log level specifying which message levels will be logged by the logger
useParentHandlers - Specify whether or not this logger should send its output to it's parent Logger. If true, then LogRecords will also be written to the parent's Handlers, and potentially to its parent, recursively up the namespace
resourceBundleName - Name of ResourceBundle to be used for localizing messages for the logger
logHandlerConfigs - An Array of LogHandlerConfig instances
Method Detail

getLogger

public Logger getLogger()
Get the Logger, configured with attributes

Returns:
A configured Logger

getLoggerName

public String getLoggerName()
Returns:
Get the Logger name

getLoggerLevel

public Level getLoggerLevel()
Returns:
Get the Level for the Logger

hashCode

public int hashCode()
Override hashCode

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Override equals

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

isNewLogger

public static boolean isNewLogger(LoggerConfig lConf,
                                  LoggerConfig[] loggerConfigs)
Determine if the current Logger is a new Logger

Parameters:
lConf - The LoggerConfig to examine
loggerConfigs - The current LoggerConfig
Returns:
True if the Logger is new, false otherwise

levelChanged

public static boolean levelChanged(LoggerConfig lConf,
                                   LoggerConfig[] loggerConfigs)
Determine if the LoggerConfig provides a Level change

Parameters:
lConf - The LoggerConfig to examine
loggerConfigs - The current LoggerConfig
Returns:
True if the Level requires changing, false otherwise

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.