Package org.apache.activemq.broker.jmx
Class Log4JConfigView
- java.lang.Object
-
- org.apache.activemq.broker.jmx.Log4JConfigView
-
- All Implemented Interfaces:
Log4JConfigViewMBean
public class Log4JConfigView extends Object implements Log4JConfigViewMBean
-
-
Constructor Summary
Constructors Constructor Description Log4JConfigView()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
doReloadLog4jProperties()
List<String>
getLoggers()
list of all the logger names and their levelsString
getLogLevel(String loggerName)
Get the log level for a given loggerString
getRootLogLevel()
Get the log level for the root loggerstatic boolean
isLog4JAvailable()
void
reloadLog4jProperties()
Reloads log4j.properties from the classpath.void
setLogLevel(String loggerName, String level)
Set the log level for a given loggervoid
setRootLogLevel(String level)
Get the log level for the root logger
-
-
-
Method Detail
-
getRootLogLevel
public String getRootLogLevel() throws Exception
Description copied from interface:Log4JConfigViewMBean
Get the log level for the root logger- Specified by:
getRootLogLevel
in interfaceLog4JConfigViewMBean
- Throws:
Exception
- if an error occurs while getting the root level.
-
setRootLogLevel
public void setRootLogLevel(String level) throws Exception
Description copied from interface:Log4JConfigViewMBean
Get the log level for the root logger- Specified by:
setRootLogLevel
in interfaceLog4JConfigViewMBean
- Parameters:
level
- the new level to assign to the root logger.- Throws:
Exception
- if an error occurs while setting the root level.
-
getLoggers
public List<String> getLoggers() throws Exception
Description copied from interface:Log4JConfigViewMBean
list of all the logger names and their levels- Specified by:
getLoggers
in interfaceLog4JConfigViewMBean
- Returns:
- a List of all known loggers names.
- Throws:
Exception
- if an error occurs while getting the loggers.
-
getLogLevel
public String getLogLevel(String loggerName) throws Exception
Description copied from interface:Log4JConfigViewMBean
Get the log level for a given logger- Specified by:
getLogLevel
in interfaceLog4JConfigViewMBean
- Parameters:
loggerName
- the name of the logger whose level should be queried.- Returns:
- the current log level of the given logger.
- Throws:
Exception
- if an error occurs while getting the log level.
-
setLogLevel
public void setLogLevel(String loggerName, String level) throws Exception
Description copied from interface:Log4JConfigViewMBean
Set the log level for a given logger- Specified by:
setLogLevel
in interfaceLog4JConfigViewMBean
- Parameters:
loggerName
- the name of the logger whose level is to be adjusted.level
- the new level to assign the given logger.- Throws:
Exception
- if an error occurs while setting the log level.
-
reloadLog4jProperties
public void reloadLog4jProperties() throws Throwable
Description copied from interface:Log4JConfigViewMBean
Reloads log4j.properties from the classpath.- Specified by:
reloadLog4jProperties
in interfaceLog4JConfigViewMBean
- Throws:
Exception
- if an error occurs trying to reload the config file.Throwable
-
doReloadLog4jProperties
public static void doReloadLog4jProperties() throws Throwable
- Throws:
Throwable
-
isLog4JAvailable
public static boolean isLog4JAvailable()
-
-