@InterfaceAudience.Public @InterfaceStability.Stable public class Log4jConfigLoader extends Object implements Log4jConfigLoaderMBean
| Constructor and Description |
|---|
Log4jConfigLoader(String log4jConfigFileName,
int interval)
Instantiates a new log4j config loader.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getContent()
Gets the log4j content.
|
int |
getInterval()
Gets the interval of the logFile loader that is pre-configured.
|
String |
getLevel()
Gets the current root log level configured.
|
String |
getLevelAsString() |
String |
getLevelHelp() |
String |
getLogFileName()
Gets the full qualified log file name.
|
long |
lastLoaded()
Gets the timeStamp of the logFile when it is Last loaded.
|
void |
reload()
The Default LogFile will be loaded for every pre-configured interval, but
this request Reloads the logFile forcefully.
|
void |
reload(String fileName) |
void |
setContent(Object logFileConfig)
Sets the content.
|
void |
setInterval(int interval)
Sets the interval of the logFile loader, replaces the value that is
pre-configured for this instance.
|
void |
setLevel(int level) |
void |
setLevel(String level)
It is an admin's helper method to set the log level on demand thru JMX,
It can be done by changing the root log level entry in log properties
too.
Sets the Root Log level, that is passed as an String. |
String |
setLogFileName(String logFileName)
Sets the log file name.
|
public Log4jConfigLoader(String log4jConfigFileName, int interval) throws Log4jConfigLoaderException
log4jConfigFileName - the log4j config file nameinterval - the intervalLog4jConfigLoaderException - the log4j config loader exceptionpublic long lastLoaded()
Log4jConfigLoaderMBeanlastLoaded in interface Log4jConfigLoaderMBeanpublic void reload()
Log4jConfigLoaderMBeanreload in interface Log4jConfigLoaderMBeanpublic void reload(String fileName)
public String getLogFileName()
Log4jConfigLoaderMBeangetLogFileName in interface Log4jConfigLoaderMBeanpublic int getInterval()
Log4jConfigLoaderMBeangetInterval in interface Log4jConfigLoaderMBeanpublic void setInterval(int interval)
Log4jConfigLoaderMBeansetInterval in interface Log4jConfigLoaderMBeaninterval - the new intervalpublic String getLevel()
Log4jConfigLoaderMBeanLog4jConfigLoaderMBean.setLevel(String). method.getLevel in interface Log4jConfigLoaderMBeanpublic String getLevelAsString()
public void setLevel(int level)
public void setLevel(String level)
Log4jConfigLoaderMBeanOFF has the highest possible
rank and is intended to turn off logging.
FATAL level designates very severe error
events that will presumably lead the application to abort.ERROR level designates error events that
might still allow the application to continue running.WARN level designates potentially harmful
situations.INFO level designates informational messages
that highlight the progress of the application at coarse-grained level.
DEBUG Level designates fine-grained
informational events that are most useful to debug an application.TRACE Level designates finer-grained
informational events than the DEBUG level.ALL has the lowest possible rank and is
intended to turn on all logging.
setLevel in interface Log4jConfigLoaderMBeanlevel - the new levelpublic String getLevelHelp()
public Object getContent()
Log4jConfigLoaderMBeangetContent in interface Log4jConfigLoaderMBeanpublic String setLogFileName(String logFileName)
Log4jConfigLoaderMBeansetLogFileName in interface Log4jConfigLoaderMBeanlogFileName - the log file namepublic void setContent(Object logFileConfig)
Log4jConfigLoaderMBeansetContent in interface Log4jConfigLoaderMBeanlogFileConfig - the new contentCopyright © 2016 utils4j. All Rights Reserved.