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
Log4JConfigViewMBean
getRootLogLevel
in interface Log4JConfigViewMBean
Exception
- if an error occurs while getting the root level.public void setRootLogLevel(String level) throws Exception
Log4JConfigViewMBean
setRootLogLevel
in interface Log4JConfigViewMBean
level
- 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
Log4JConfigViewMBean
getLoggers
in interface Log4JConfigViewMBean
Exception
- if an error occurs while getting the loggers.public String getLogLevel(String loggerName) throws Exception
Log4JConfigViewMBean
getLogLevel
in interface Log4JConfigViewMBean
loggerName
- 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
Log4JConfigViewMBean
setLogLevel
in interface Log4JConfigViewMBean
loggerName
- 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
Log4JConfigViewMBean
reloadLog4jProperties
in interface Log4JConfigViewMBean
Exception
- if an error occurs trying to reload the config file.Throwable
public static void doReloadLog4jProperties() throws Throwable
Throwable
public static boolean isLog4JAvailable()
Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.