org.apache.ws.jaxme.logging

Class LoggerAccess

public class LoggerAccess extends Object

This class implements access to the Loggers through static methods. The class typically configures itself from the environment. However, you may choose to configure the class explicitly by invoking {@link #setLoggerFactory(LoggerFactory)}.

Author: Jochen Wiedmann

Method Summary
static LoggergetLogger(String pName)

Returns a new logger with the given name.

static LoggergetLogger(Class pClass)

Shortcut for getLogger(pClass.getName()).

static LoggerFactorygetLoggerFactory()

Returns the logger factory.

static LoggerFactorynewLoggerFactory()

Creates a new instance of {@link LoggerFactory}.

static voidsetLoggerFactory(LoggerFactory pFactory)

Sets the logger factory.

Method Detail

getLogger

public static Logger getLogger(String pName)

Returns a new logger with the given name.

getLogger

public static Logger getLogger(Class pClass)

Shortcut for getLogger(pClass.getName()).

getLoggerFactory

public static LoggerFactory getLoggerFactory()

Returns the logger factory. If a logger factory is set (by previous calls to {@link #newLoggerFactory()} or {@link #setLoggerFactory(LoggerFactory)}), returns that factory. Otherwise invokes these methods and returns the result.

newLoggerFactory

public static LoggerFactory newLoggerFactory()

Creates a new instance of {@link LoggerFactory}. The implementation class is determined as follows:

  1. If the system property org.apache.ws.jaxme.logging.LoggerFactory is set, uses the given class name.
  2. If the resource META-INF/services/org.apache.ws.jaxme.logging.LoggerFactory exists, uses the given class name.
  3. Otherwise returns a default instance logging to System.err.

setLoggerFactory

public static void setLoggerFactory(LoggerFactory pFactory)

Sets the logger factory.