|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.logging.Log4jService
Initializes the Log4j logging framework. Supports XML and standard configuration file formats. Defaults to using 'log4j.xml' read from a system resource.
Sets up a ThrowableListener
(src) to adapt unhandled
throwables to a logger.
Installs LoggerStream
(src) adapters for System.out and
System.err to catch and redirect calls to Log4j.
Field Summary | |
static boolean |
CATCH_SYSTEM_ERR
Default flag to enable/disable cacthing System.err. |
static boolean |
CATCH_SYSTEM_OUT
Default flag to enable/disable cacthing System.out. |
static java.lang.String |
DEFAULT_URL
The default url for the configuration file. |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
Log4jService()
Uses defaults. |
|
Log4jService(java.lang.String url)
|
|
Log4jService(java.lang.String url,
int refreshPeriod)
|
|
Log4jService(java.net.URL url)
|
|
Log4jService(java.net.URL url,
int refreshPeriod)
|
Method Summary | |
protected void |
createService()
Sub-classes should override this method to provide custum 'create' logic. |
boolean |
getCatchSystemErr()
Get the catch System.err flag. |
boolean |
getCatchSystemOut()
Get the catch System.out flag. |
java.net.URL |
getConfigurationURL()
Get the Log4j configuration URL. |
boolean |
getLog4jQuietMode()
Get the org.apache.log4j.helpers.LogLog.setQuietMode flag |
java.lang.String |
getLoggerLevel(java.lang.String name)
Gets the level of the logger of the give name. |
protected ObjectName (src) |
getObjectName(MBeanServer (src) server,
ObjectName (src) name)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration. |
int |
getRefreshPeriod()
Get the refresh period. |
void |
reconfigure()
Force the logging system to reconfigure. |
void |
reconfigure(java.lang.String url)
Hack to reconfigure and change the URL. |
void |
setCatchSystemErr(boolean flag)
Set the catch System.err flag. |
void |
setCatchSystemOut(boolean flag)
Set the catch System.out flag. |
void |
setConfigurationURL(java.net.URL url)
Set the Log4j configuration URL. |
void |
setLog4jQuietMode(boolean flag)
Set the org.apache.log4j.helpers.LogLog.setQuietMode flag |
void |
setLoggerLevel(java.lang.String name,
java.lang.String levelName)
Sets the level for a logger of the give name. |
void |
setLoggerLevels(java.lang.String list,
java.lang.String levelName)
Sets the levels of each logger specified by the given comma seperated list of logger names. |
void |
setRefreshPeriod(int refreshPeriod)
Set the refresh period. |
protected void |
startService()
Sub-classes should override this method to provide custum 'start' logic. |
protected void |
stopService()
Sub-classes should override this method to provide custum 'stop' logic. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_URL
public static final boolean CATCH_SYSTEM_OUT
public static final boolean CATCH_SYSTEM_ERR
Constructor Detail |
public Log4jService() throws java.net.MalformedURLException
java.net.MalformedURLException
- Could not create URL from default (propbably
a problem with overridden properties).public Log4jService(java.net.URL url)
url
- The configuration URL.public Log4jService(java.lang.String url) throws java.net.MalformedURLException
url
- The configuration URL.public Log4jService(java.lang.String url, int refreshPeriod) throws java.net.MalformedURLException
url
- The configuration URL.refreshPeriod
- The refreshPeriod in seconds to wait between each check.public Log4jService(java.net.URL url, int refreshPeriod)
url
- The configuration URL.refreshPeriod
- The refreshPeriod in seconds to wait between each check.Method Detail |
public void setCatchSystemOut(boolean flag)
flag
- True to enable, false to disable.public boolean getCatchSystemOut()
public void setCatchSystemErr(boolean flag)
flag
- True to enable, false to disable.public boolean getCatchSystemErr()
public boolean getLog4jQuietMode()
public void setLog4jQuietMode(boolean flag)
public int getRefreshPeriod()
public void setRefreshPeriod(int refreshPeriod)
public java.net.URL getConfigurationURL()
public void setConfigurationURL(java.net.URL url)
public void setLoggerLevel(java.lang.String name, java.lang.String levelName)
Values are trimmed before used.
name
- The name of the logger to change levellevelName
- The name of the level to change the logger to.public void setLoggerLevels(java.lang.String list, java.lang.String levelName)
list
- A comma seperated list of logger names.levelName
- The name of the level to change the logger to.setLoggerLevel(java.lang.String, java.lang.String)
public java.lang.String getLoggerLevel(java.lang.String name)
name
- The name of the logger to inspect.public void reconfigure() throws java.io.IOException
java.io.IOException
public void reconfigure(java.lang.String url) throws java.io.IOException, java.net.MalformedURLException
url
- The new configuration url
java.io.IOException
java.net.MalformedURLException
protected ObjectName (src) getObjectName(MBeanServer (src) server, ObjectName (src) name) throws MalformedObjectNameException (src)
ServiceMBeanSupport (src)
getObjectName
in class ServiceMBeanSupport (src)
MalformedObjectNameException (src)
protected void createService() throws java.lang.Exception
ServiceMBeanSupport (src)
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
createService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void startService() throws java.lang.Exception
ServiceMBeanSupport (src)
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
startService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void stopService() throws java.lang.Exception
ServiceMBeanSupport (src)
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
stopService
in class ServiceMBeanSupport (src)
java.lang.Exception
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |