public class Log4JConfigView extends Object implements Log4JConfigViewMBean
| Constructor and Description |
|---|
Log4JConfigView() |
| Modifier and Type | Method and Description |
|---|---|
static void |
doReloadLog4jProperties() |
List<String> |
getLoggers()
list of all the logger names and their levels
|
String |
getLogLevel(String loggerName)
Get the log level for a given logger
|
String |
getRootLogLevel()
Get the log level for the root logger
|
static boolean |
isLog4JAvailable() |
void |
reloadLog4jProperties()
Reloads log4j.properties from the classpath.
|
void |
setLogLevel(String loggerName,
String level)
Set the log level for a given logger
|
void |
setRootLogLevel(String level)
Get the log level for the root logger
|
public Log4JConfigView()
public String getRootLogLevel() throws Exception
Log4JConfigViewMBeangetRootLogLevel in interface Log4JConfigViewMBeanException - if an error occurs while getting the root level.public void setRootLogLevel(String level) throws Exception
Log4JConfigViewMBeansetRootLogLevel in interface Log4JConfigViewMBeanlevel - the new level to assign to the root logger.Exception - if an error occurs while setting the root level.public List<String> getLoggers() throws Exception
Log4JConfigViewMBeangetLoggers in interface Log4JConfigViewMBeanException - if an error occurs while getting the loggers.public String getLogLevel(String loggerName) throws Exception
Log4JConfigViewMBeangetLogLevel in interface Log4JConfigViewMBeanloggerName - the name of the logger whose level should be queried.Exception - if an error occurs while getting the log level.public void setLogLevel(String loggerName, String level) throws Exception
Log4JConfigViewMBeansetLogLevel in interface Log4JConfigViewMBeanloggerName - the name of the logger whose level is to be adjusted.level - the new level to assign the given logger.Exception - if an error occurs while setting the log level.public void reloadLog4jProperties() throws Throwable
Log4JConfigViewMBeanreloadLog4jProperties in interface Log4JConfigViewMBeanException - if an error occurs trying to reload the config file.Throwablepublic static void doReloadLog4jProperties() throws Throwable
Throwablepublic static boolean isLog4JAvailable()
Copyright © 2005–2015 FuseSource, Corp.. All rights reserved.