mx4j.log

Class Log

public class Log extends Object

Main class for the log service.

The system property 'mx4j.log.priority' controls the priority of the standard logging, and defaults to 'warn'. Possible values are, from least to greatest priority, the following (case insensitive):

Version: $Revision: 1.7 $

Method Summary
static intgetDefaultPriority()
Returns the default priority.
static LoggergetLogger(String category)
Returns a new instance of a Logger associated with the given category; if Log has been called then a new instance of the prototype Logger, associated with the given category, is returned.
static voidredirectTo(Logger prototype)
Tells to the log service to use the given delegate Logger to perform logging.
static voidredirectTo(Logger prototype, String category)
Tells to the log service to use the given delegate Logger to perform logging for the given category (that cannot be null).
static voidsetDefaultPriority(int priority)
Sets the default priority for all loggers.

Method Detail

getDefaultPriority

public static int getDefaultPriority()
Returns the default priority.

See Also: Log

getLogger

public static Logger getLogger(String category)
Returns a new instance of a Logger associated with the given category; if Log has been called then a new instance of the prototype Logger, associated with the given category, is returned. This requires the prototype Logger class to have a public parameterless constructor.

redirectTo

public static void redirectTo(Logger prototype)
Tells to the log service to use the given delegate Logger to perform logging.
Use a null delegate to remove redirection.

See Also: Log

redirectTo

public static void redirectTo(Logger prototype, String category)
Tells to the log service to use the given delegate Logger to perform logging for the given category (that cannot be null).
Settings made using this method overrides the ones made with redirectTo
, meaning that it is possible to redirect all the log to a certain delegate but certain categories. Use a null delegate to remove redirection for the specified category.

See Also: Log

setDefaultPriority

public static void setDefaultPriority(int priority)
Sets the default priority for all loggers.

See Also: Log

Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.