org.ow2.jonas.lib.util
Class Log

java.lang.Object
  extended by org.ow2.jonas.lib.util.Log

public class Log
extends Object

This class provides utility method for using Monolog.

Author:
Philippe Coq., Sebastien Chassande-Barrioz sebastien.chassande@inrialpes.fr, Philippe Durieux, Florent Benoit & Ludovic Bert, Adriana Danes : change MBean implementation model from inheritance to delegation

Field Summary
static String JONAS_ADMIN_PREFIX
           
static String JONAS_BOOTSTRAP_PREFIX
           
static String JONAS_CLUSTER_DAEMON
           
static String JONAS_CSIV2_DETAILS_SECURITY_PREFIX
           
static String JONAS_CSIV2_SECURITY_PREFIX
           
static String JONAS_DB_PREFIX
           
static String JONAS_DBM_PREFIX
           
static String JONAS_DEPLOY_PREFIX
           
static String JONAS_DEPLOY_WORK_PREFIX
           
static String JONAS_DISCOVERY_PREFIX
           
static String JONAS_EAR_PREFIX
           
static String JONAS_EJB_PREFIX
           
static String JONAS_GENBASE_PREFIX
           
static String JONAS_GENIC_PREFIX
           
static String JONAS_GENIC_VELOCITY_PREFIX
           
static String JONAS_JACC_SECURITY_PREFIX
           
static String JONAS_JAXR_PREFIX
           
static String JONAS_JCA_PREFIX
           
static String JONAS_JMX_PREFIX
           
static String JONAS_LOADER_PREFIX
           
static String JONAS_MAIL_PREFIX
           
static String JONAS_MANAGEMENT_EVENT_PREFIX
           
static String JONAS_MANAGEMENT_PREFIX
           
static String JONAS_NAMING_PREFIX
           
static String JONAS_PROPCTX_PREFIX
           
static String JONAS_REGISTRY_PREFIX
           
static String JONAS_SECURITY_PREFIX
           
static String JONAS_SERVER_PREFIX
           
static String JONAS_TESTS_PREFIX
           
static String JONAS_WEB_PREFIX
           
static String JONAS_WORK_MGR_PREFIX
           
static String JONAS_WS_SECURITY_PREFIX
           
static String JONAS_WSGEN_EWS_PREFIX
           
static String JONAS_WSGEN_PREFIX
           
static String SPY_LOGGER_NAME
           
 
Method Summary
static void configure(String file)
          Configure Logger.
static String getConfigFileName()
           
static org.objectweb.util.monolog.api.Handler getHandler(String handlerName)
          Return a given Monolog handler
static org.objectweb.util.monolog.api.Handler getJmxHandler()
           
static org.objectweb.util.monolog.api.LevelFactory getLevelFactory()
          Shortcut that returns the LevelFactory
static org.objectweb.util.monolog.api.Logger getLogger(String topic)
          Shortcut to get the Logger by its topic name.
static org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
          It returns the unique LoggerFactory used in JOnAS.
static PrintWriter getLogWriter(String topic)
          Returns the standard PrintWriter associated to the logger defined by its topic.
static Properties getProperties()
           
static void reset()
          Reset logger factory
static org.objectweb.util.monolog.api.Level setComponentLogLevel(String loggerName, org.objectweb.util.monolog.api.Level level)
          Set the given log level to the specified logger.
static void setConfigFileName(String configFileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JONAS_ADMIN_PREFIX

public static final String JONAS_ADMIN_PREFIX
See Also:
Constant Field Values

JONAS_BOOTSTRAP_PREFIX

public static final String JONAS_BOOTSTRAP_PREFIX
See Also:
Constant Field Values

JONAS_CLUSTER_DAEMON

public static final String JONAS_CLUSTER_DAEMON
See Also:
Constant Field Values

JONAS_DB_PREFIX

public static final String JONAS_DB_PREFIX
See Also:
Constant Field Values

JONAS_DBM_PREFIX

public static final String JONAS_DBM_PREFIX
See Also:
Constant Field Values

JONAS_DEPLOY_PREFIX

public static final String JONAS_DEPLOY_PREFIX
See Also:
Constant Field Values

JONAS_DISCOVERY_PREFIX

public static final String JONAS_DISCOVERY_PREFIX
See Also:
Constant Field Values

JONAS_EAR_PREFIX

public static final String JONAS_EAR_PREFIX
See Also:
Constant Field Values

JONAS_EJB_PREFIX

public static final String JONAS_EJB_PREFIX
See Also:
Constant Field Values

SPY_LOGGER_NAME

public static final String SPY_LOGGER_NAME
See Also:
Constant Field Values

JONAS_JAXR_PREFIX

public static final String JONAS_JAXR_PREFIX
See Also:
Constant Field Values

JONAS_GENBASE_PREFIX

public static final String JONAS_GENBASE_PREFIX
See Also:
Constant Field Values

JONAS_GENIC_PREFIX

public static final String JONAS_GENIC_PREFIX
See Also:
Constant Field Values

JONAS_GENIC_VELOCITY_PREFIX

public static final String JONAS_GENIC_VELOCITY_PREFIX
See Also:
Constant Field Values

JONAS_WSGEN_PREFIX

public static final String JONAS_WSGEN_PREFIX
See Also:
Constant Field Values

JONAS_WSGEN_EWS_PREFIX

public static final String JONAS_WSGEN_EWS_PREFIX
See Also:
Constant Field Values

JONAS_JCA_PREFIX

public static final String JONAS_JCA_PREFIX
See Also:
Constant Field Values

JONAS_JMX_PREFIX

public static final String JONAS_JMX_PREFIX
See Also:
Constant Field Values

JONAS_WORK_MGR_PREFIX

public static final String JONAS_WORK_MGR_PREFIX
See Also:
Constant Field Values

JONAS_LOADER_PREFIX

public static final String JONAS_LOADER_PREFIX
See Also:
Constant Field Values

JONAS_MAIL_PREFIX

public static final String JONAS_MAIL_PREFIX
See Also:
Constant Field Values

JONAS_MANAGEMENT_PREFIX

public static final String JONAS_MANAGEMENT_PREFIX
See Also:
Constant Field Values

JONAS_MANAGEMENT_EVENT_PREFIX

public static final String JONAS_MANAGEMENT_EVENT_PREFIX
See Also:
Constant Field Values

JONAS_NAMING_PREFIX

public static final String JONAS_NAMING_PREFIX
See Also:
Constant Field Values

JONAS_PROPCTX_PREFIX

public static final String JONAS_PROPCTX_PREFIX
See Also:
Constant Field Values

JONAS_REGISTRY_PREFIX

public static final String JONAS_REGISTRY_PREFIX
See Also:
Constant Field Values

JONAS_SECURITY_PREFIX

public static final String JONAS_SECURITY_PREFIX
See Also:
Constant Field Values

JONAS_CSIV2_SECURITY_PREFIX

public static final String JONAS_CSIV2_SECURITY_PREFIX
See Also:
Constant Field Values

JONAS_CSIV2_DETAILS_SECURITY_PREFIX

public static final String JONAS_CSIV2_DETAILS_SECURITY_PREFIX
See Also:
Constant Field Values

JONAS_JACC_SECURITY_PREFIX

public static final String JONAS_JACC_SECURITY_PREFIX
See Also:
Constant Field Values

JONAS_WS_SECURITY_PREFIX

public static final String JONAS_WS_SECURITY_PREFIX
See Also:
Constant Field Values

JONAS_SERVER_PREFIX

public static final String JONAS_SERVER_PREFIX
See Also:
Constant Field Values

JONAS_WEB_PREFIX

public static final String JONAS_WEB_PREFIX
See Also:
Constant Field Values

JONAS_DEPLOY_WORK_PREFIX

public static final String JONAS_DEPLOY_WORK_PREFIX
See Also:
Constant Field Values

JONAS_TESTS_PREFIX

public static final String JONAS_TESTS_PREFIX
See Also:
Constant Field Values
Method Detail

configure

public static void configure(String file)
Configure Logger.

Parameters:
file - The configuration file for monolog (usually: trace.properties)

getJmxHandler

public static org.objectweb.util.monolog.api.Handler getJmxHandler()
Returns:
a jmx handler. If several, return the first one. If none, return null;

getHandler

public static org.objectweb.util.monolog.api.Handler getHandler(String handlerName)
Return a given Monolog handler

Parameters:
handlerName - the name of the handler
Returns:
the corresponding Monolog handler

getLoggerFactory

public static org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
It returns the unique LoggerFactory used in JOnAS. initialize it if not already done.

Returns:
the unique LoggerFactory used in JOnAS.

reset

public static void reset()
Reset logger factory


getLogWriter

public static PrintWriter getLogWriter(String topic)
Returns the standard PrintWriter associated to the logger defined by its topic. This is mainly used for DBM and Connectors.


getLevelFactory

public static org.objectweb.util.monolog.api.LevelFactory getLevelFactory()
Shortcut that returns the LevelFactory


getLogger

public static org.objectweb.util.monolog.api.Logger getLogger(String topic)
Shortcut to get the Logger by its topic name.

Parameters:
topic - the topic of the returned logger
Returns:
always a logger instance (never null value).

getProperties

public static Properties getProperties()

getConfigFileName

public static String getConfigFileName()

setConfigFileName

public static void setConfigFileName(String configFileName)

setComponentLogLevel

public static org.objectweb.util.monolog.api.Level setComponentLogLevel(String loggerName,
                                                                        org.objectweb.util.monolog.api.Level level)
Set the given log level to the specified logger.

Parameters:
loggerName - name of the loger to be configured
level - target level
Returns:
the previous level of the logger


Copyright © 2010 OW2 Consortium. All Rights Reserved.