Class Log4jConfigurator
java.lang.Object
com.reallifedeveloper.common.infrastructure.jmx.Log4jConfigurator
- All Implemented Interfaces:
LogConfiguratorMXBean
@ManagedResource(description="Log4j Configuration")
public class Log4jConfigurator
extends Object
implements LogConfiguratorMXBean
An implementation of the JMX
LogConfiguratorMXBean interface using Log4j.- Author:
- RealLifeDeveloper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGives a list with the names of the loggers defined.getLogLevel(String loggerName) Gives the log level of the named logger.voidsetLogLevel(String loggerName, String level) Sets the log level of the named logger.
-
Constructor Details
-
Log4jConfigurator
public Log4jConfigurator()
-
-
Method Details
-
getLoggers
Description copied from interface:LogConfiguratorMXBeanGives a list with the names of the loggers defined.- Specified by:
getLoggersin interfaceLogConfiguratorMXBean- Returns:
- a list with the logger names
-
getLogLevel
@ManagedOperation(description="Gives the log level for a logger") @ManagedOperationParameters(@ManagedOperationParameter(name="logger",description="The name of the logger")) public String getLogLevel(String loggerName) Description copied from interface:LogConfiguratorMXBeanGives the log level of the named logger.- Specified by:
getLogLevelin interfaceLogConfiguratorMXBean- Parameters:
loggerName- the name of the logger- Returns:
- the log level of
logger
-
setLogLevel
@ManagedOperation(description="Sets the log level for a logger") @ManagedOperationParameter(name="logger",description="The name of the logger") @ManagedOperationParameter(name="level",description="The new log level") public void setLogLevel(String loggerName, String level) Description copied from interface:LogConfiguratorMXBeanSets the log level of the named logger.- Specified by:
setLogLevelin interfaceLogConfiguratorMXBean- Parameters:
loggerName- the name of the loggerlevel- the new log level
-