| Constructor: |
public Log4jService() throws MalformedURLException {
this(DEFAULT_URL, 60);
}
Throws:
MalformedURLException - Could not create URL from default (propbably
a problem with overridden properties).
- jmx:managed-constructor:
|
public Log4jService(URL url) {
this(url, 60);
}
Parameters:
url - The configuration URL.
- jmx:managed-constructor:
|
public Log4jService(String url) throws MalformedURLException {
this(Strings.toURL(url), 60);
}
Parameters:
url - The configuration URL.
- jmx:managed-constructor:
|
public Log4jService(String url,
int refreshPeriod) throws MalformedURLException {
this(Strings.toURL(url), refreshPeriod);
}
Parameters:
url - The configuration URL.
refreshPeriod - The refreshPeriod in seconds to wait between each check.
- jmx:managed-constructor:
|
public Log4jService(URL url,
int refreshPeriod) {
this.configURL = url;
this.refreshPeriod = refreshPeriod;
}
Parameters:
url - The configuration URL.
refreshPeriod - The refreshPeriod in seconds to wait between each check.
- jmx:managed-constructor:
|
| Method from org.jboss.logging.Log4jService Detail: |
protected void createService() throws Exception {
setup();
}
|
protected void emitReconfigureNotification() {
// emit a reconfigure notification with the configURL
Notification n = new Notification(RECONFIGURE_NOTIFICATION_TYPE,
this, getNextNotificationSequenceNumber(), "Log4j subsystem reconfigured");
n.setUserData(configURL);
super.sendNotification(n);
}
|
public boolean getCatchSystemErr() {
return catchSystemErr;
}
Get the catch System.err flag. |
public boolean getCatchSystemOut() {
return catchSystemOut;
}
Get the catch System.out flag. |
public URL getConfigurationURL() {
return configURL;
}
Get the Log4j configuration URL. |
public String getDefaultJBossServerLogThreshold() {
return defaultJBossServerLogLevel;
}
|
public boolean getLog4jQuietMode() {
return log4jQuietMode;
}
Get the org.apache.log4j.helpers.LogLog.setQuietMode flag |
public String getLoggerLevel(String name) {
org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(name);
Level level = logger.getLevel();
if (level != null)
return level.toString();
return null;
}
Gets the level of the logger of the give name. |
protected ObjectName getObjectName(MBeanServer server,
ObjectName name) throws MalformedObjectNameException {
return name == null ? OBJECT_NAME : name;
}
|
public int getRefreshPeriod() {
return refreshPeriod;
}
|
public void reconfigure() throws IOException {
if (timerTask == null)
throw new IllegalStateException("Service stopped or not started");
timerTask.reconfigure();
}
Force the logging system to reconfigure. |
public void reconfigure(String url) throws IOException, MalformedURLException {
setConfigurationURL(Strings.toURL(url));
reconfigure();
}
Hack to reconfigure and change the URL. This is needed until we
have a JMX HTML Adapter that can use PropertyEditor to coerce. |
public void setCatchSystemErr(boolean flag) {
this.catchSystemErr = flag;
}
Set the catch System.err flag. |
public void setCatchSystemOut(boolean flag) {
this.catchSystemOut = flag;
}
Set the catch System.out flag. |
public void setConfigurationURL(URL url) {
this.configURL = url;
}
Set the Log4j configuration URL. |
public void setDefaultJBossServerLogThreshold(String level) {
this.defaultJBossServerLogLevel = level;
}
|
public void setLog4jQuietMode(boolean flag) {
this.log4jQuietMode = flag;
}
Set the org.apache.log4j.helpers.LogLog.setQuietMode flag |
public void setLoggerLevel(String name,
String levelName) {
org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(name.trim());
Level level = JDKLevel.toLevel(levelName.trim());
logger.setLevel(level);
log.info("Level set to " + level + " for " + name);
}
|
public void setLoggerLevels(String list,
String levelName) {
StringTokenizer stok = new StringTokenizer(list, ",");
while (stok.hasMoreTokens()) {
String name = stok.nextToken();
setLoggerLevel(name, levelName);
}
}
Sets the levels of each logger specified by the given comma
seperated list of logger names. |
public void setRefreshPeriod(int refreshPeriod) {
this.refreshPeriod = refreshPeriod;
}
|
protected void startService() throws Exception {
setup();
}
|
protected void stopService() throws Exception {
timer.cancel();
timer = null;
timerTask.cancel();
timerTask = null;
// Remove throwable adapter
ThrowableHandler.removeThrowableListener(throwableAdapter);
throwableAdapter = null;
uninstallSystemAdapters();
// allow start to re-initalize
initialized = false;
}
|