org.x4juli.global.helper
Class LoggerUtil

java.lang.Object
  extended byorg.x4juli.global.components.AbstractComponent
      extended byorg.x4juli.global.helper.LoggerUtil
All Implemented Interfaces:
Component

public final class LoggerUtil
extends AbstractComponent

Author:
Boris Unckel

Field Summary
private static LoggerUtil INSTANCE
           
 
Fields inherited from class org.x4juli.global.components.AbstractComponent
manager, repository
 
Constructor Summary
private LoggerUtil()
          No instanciation wanted
 
Method Summary
static java.util.logging.Logger configureLogger(java.util.logging.Logger logger)
          Configures the logger.
static java.util.logging.Logger configureLogger(java.util.logging.Logger logger, java.util.logging.Formatter formatter)
          Configures the logger.
static java.util.logging.Logger configureLogger(java.util.logging.Logger logger, java.util.logging.Formatter formatter, java.util.logging.Handler handler)
          Configures the logger.
static java.util.logging.Logger configureLogger(java.util.logging.Logger logger, java.util.logging.Formatter formatter, java.util.logging.Handler handler, java.util.logging.Filter filter)
          Configures the logger.
static java.util.logging.Logger configureLogger(java.util.logging.Logger logger, java.util.logging.Formatter formatter, java.util.logging.Handler handler, java.util.logging.Filter filter, java.util.logging.Level level)
          Configures the logger.
static java.util.logging.Logger configureLogger(java.util.logging.Logger logger, java.util.logging.Formatter formatter, java.util.logging.Handler handler, java.util.logging.Filter filter, java.util.logging.Level level, boolean addHandlers)
          Configures a new logger with the following options.
static java.util.logging.Logger createLogger(java.lang.Class clazz, java.util.logging.Formatter formatter, java.util.logging.Handler handler)
          Retrieves a new logger and configures it with the following options.
static java.util.logging.Logger createLogger(java.lang.String logName)
          Retrieves a new logger and configures it with the following options.
static java.util.logging.Logger createLogger(java.lang.String logName, java.util.logging.Formatter formatter)
          Retrieves a new logger and configures it with the following options.
static java.util.logging.Logger createLogger(java.lang.String logName, java.util.logging.Formatter formatter, java.util.logging.Handler handler)
          Retrieves a new logger and configures it with the following options.
static java.util.logging.Logger createLogger(java.lang.String logName, java.util.logging.Formatter formatter, java.util.logging.Handler handler, java.util.logging.Filter filter)
          Retrieves a new logger and configures it with the following options.
static java.util.logging.Logger createLogger(java.lang.String logName, java.util.logging.Formatter formatter, java.util.logging.Handler handler, java.util.logging.Filter filter, java.util.logging.Level level)
          Retrieves a new logger and configures it with the following options.
static java.util.logging.Logger createLogger(java.lang.String logName, java.util.logging.Formatter formatter, java.util.logging.Handler handler, java.util.logging.Filter filter, java.util.logging.Level level, boolean addHandlers)
          Retrieves a new logger and configures it with the following options.
private static ExtendedLogger getInternalLogger()
          Retrieves the internal logger.
static void removeAllHandlers(java.util.logging.Logger logger)
          Removes all handlers of an existing logger.
 
Methods inherited from class org.x4juli.global.components.AbstractComponent
getLogger, getLoggerRepository, getMessageProperties, getNonFloodingLogger, getProperty, getProperty, getProperty, getProperty, resetErrorCount, setObjectStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

private static final LoggerUtil INSTANCE
Constructor Detail

LoggerUtil

private LoggerUtil()
No instanciation wanted

Method Detail

removeAllHandlers

public static void removeAllHandlers(java.util.logging.Logger logger)
Removes all handlers of an existing logger.

Parameters:
logger - to remove the handlers from.
Since:
0.5

createLogger

public static java.util.logging.Logger createLogger(java.lang.Class clazz,
                                                    java.util.logging.Formatter formatter,
                                                    java.util.logging.Handler handler)
Retrieves a new logger and configures it with the following options.

Since:
0.5
See Also:
createLogger(String, Formatter, Handler, Filter, Level, boolean), configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

createLogger

public static java.util.logging.Logger createLogger(java.lang.String logName)
Retrieves a new logger and configures it with the following options.

Since:
0.5
See Also:
createLogger(String, Formatter, Handler, Filter, Level, boolean), configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

createLogger

public static java.util.logging.Logger createLogger(java.lang.String logName,
                                                    java.util.logging.Formatter formatter)
Retrieves a new logger and configures it with the following options.

Since:
0.5
See Also:
createLogger(String, Formatter, Handler, Filter, Level, boolean), configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

createLogger

public static java.util.logging.Logger createLogger(java.lang.String logName,
                                                    java.util.logging.Formatter formatter,
                                                    java.util.logging.Handler handler)
Retrieves a new logger and configures it with the following options.

Since:
0.5
See Also:
createLogger(String, Formatter, Handler, Filter, Level, boolean), configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

createLogger

public static java.util.logging.Logger createLogger(java.lang.String logName,
                                                    java.util.logging.Formatter formatter,
                                                    java.util.logging.Handler handler,
                                                    java.util.logging.Filter filter)
Retrieves a new logger and configures it with the following options.

Since:
0.5
See Also:
createLogger(String, Formatter, Handler, Filter, Level, boolean), configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

createLogger

public static java.util.logging.Logger createLogger(java.lang.String logName,
                                                    java.util.logging.Formatter formatter,
                                                    java.util.logging.Handler handler,
                                                    java.util.logging.Filter filter,
                                                    java.util.logging.Level level)
Retrieves a new logger and configures it with the following options.

Since:
0.5
See Also:
createLogger(String, Formatter, Handler, Filter, Level, boolean), configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

createLogger

public static java.util.logging.Logger createLogger(java.lang.String logName,
                                                    java.util.logging.Formatter formatter,
                                                    java.util.logging.Handler handler,
                                                    java.util.logging.Filter filter,
                                                    java.util.logging.Level level,
                                                    boolean addHandlers)
Retrieves a new logger and configures it with the following options.

Parameters:
logName - of the retrieved logger.
formatter - to use with the handler.
handler - to use with the logger.
filter - to use with the handler.
level - to use with logger and handler.
addHandlers - to remove existing handlers or not.
Returns:
the configured logger.
Since:
0.5
See Also:
configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

configureLogger

public static java.util.logging.Logger configureLogger(java.util.logging.Logger logger)
Configures the logger. Details:

Since:
0.5
See Also:
configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

configureLogger

public static java.util.logging.Logger configureLogger(java.util.logging.Logger logger,
                                                       java.util.logging.Formatter formatter)
Configures the logger. Details:

Since:
0.5
See Also:
configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

configureLogger

public static java.util.logging.Logger configureLogger(java.util.logging.Logger logger,
                                                       java.util.logging.Formatter formatter,
                                                       java.util.logging.Handler handler)
Configures the logger. Details:

Since:
0.5
See Also:
configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

configureLogger

public static java.util.logging.Logger configureLogger(java.util.logging.Logger logger,
                                                       java.util.logging.Formatter formatter,
                                                       java.util.logging.Handler handler,
                                                       java.util.logging.Filter filter)
Configures the logger. Details:

Since:
0.5
See Also:
configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

configureLogger

public static java.util.logging.Logger configureLogger(java.util.logging.Logger logger,
                                                       java.util.logging.Formatter formatter,
                                                       java.util.logging.Handler handler,
                                                       java.util.logging.Filter filter,
                                                       java.util.logging.Level level)
Configures the logger. Details:

Since:
0.5
See Also:
configureLogger(Logger, Formatter, Handler, Filter, Level, boolean)

configureLogger

public static java.util.logging.Logger configureLogger(java.util.logging.Logger logger,
                                                       java.util.logging.Formatter formatter,
                                                       java.util.logging.Handler handler,
                                                       java.util.logging.Filter filter,
                                                       java.util.logging.Level level,
                                                       boolean addHandlers)
Configures a new logger with the following options.

Parameters:
logger - to configure.
formatter - to use with the appender, activate options is called, SimpleFormatter is default.
handler - to use with the logger, ConsoleHandler is default.
filter - to use with the handler, null is default.
level - to use with logger and handler, Level.ALL is default.
addHandlers - to remove all other handlers or not.
Returns:
the configured logger.
Since:
0.5

getInternalLogger

private static ExtendedLogger getInternalLogger()
Retrieves the internal logger.

Returns:
internal Logger for this class
Since:
0.5


${license_html}