| org.jboss.logging.Log4jService
Log4jService | public class Log4jService extends ServiceMBeanSupport implements Log4jServiceMBean(Code) | | 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 to adapt unhandled
throwables to a logger.
Installs
LoggerStream adapters for System.out and
System.err to catch and redirect calls to Log4j.
version: $Revision: 57209 $ author: Fulco Muriglio author: Scott Stark author: David Jencks author: Jason Dillon |
Field Summary | |
final public static boolean | CATCH_SYSTEM_ERR Default flag to enable/disable cacthing System.err. | final public static boolean | CATCH_SYSTEM_OUT Default flag to enable/disable cacthing System.out. | final public static String | DEFAULT_URL The default url for the configuration file. |
CATCH_SYSTEM_ERR | final public static boolean CATCH_SYSTEM_ERR(Code) | | Default flag to enable/disable cacthing System.err. Reads the value
from the system property org.jboss.logging.Log4jService.catchSystemErr
or if not set defaults to true.
|
CATCH_SYSTEM_OUT | final public static boolean CATCH_SYSTEM_OUT(Code) | | Default flag to enable/disable cacthing System.out. Reads the value
from the system property org.jboss.logging.Log4jService.catchSystemOut
or if not set defaults to true.
|
DEFAULT_URL | final public static String DEFAULT_URL(Code) | | The default url for the configuration file. Reads the value
from the system property org.jboss.logging.Log4jService.configURL
or if that is not set defaults to resource:log4j.xml.
|
Log4jService | public Log4jService(URL url)(Code) | | Parameters: url - The configuration URL. |
Log4jService | public Log4jService(String url, int refreshPeriod) throws MalformedURLException(Code) | | Parameters: url - The configuration URL. Parameters: refreshPeriod - The refreshPeriod in seconds to wait between each check. |
Log4jService | public Log4jService(URL url, int refreshPeriod)(Code) | | Parameters: url - The configuration URL. Parameters: refreshPeriod - The refreshPeriod in seconds to wait between each check. |
emitReconfigureNotification | protected void emitReconfigureNotification()(Code) | | |
getCatchSystemErr | public boolean getCatchSystemErr()(Code) | | Get the catch System.err flag.
True if enabled, false if disabled. |
getCatchSystemOut | public boolean getCatchSystemOut()(Code) | | Get the catch System.out flag.
True if enabled, false if disabled. |
getConfigurationURL | public URL getConfigurationURL()(Code) | | Get the Log4j configuration URL.
|
getLog4jQuietMode | public boolean getLog4jQuietMode()(Code) | | Get the org.apache.log4j.helpers.LogLog.setQuietMode flag
True if enabled, false if disabled. |
getLoggerLevel | public String getLoggerLevel(String name)(Code) | | Gets the level of the logger of the give name.
Parameters: name - The name of the logger to inspect. |
getRefreshPeriod | public int getRefreshPeriod()(Code) | | Get the refresh period.
|
reconfigure | public void reconfigure() throws IOException(Code) | | Force the logging system to reconfigure.
|
reconfigure | public void reconfigure(String url) throws IOException, MalformedURLException(Code) | | Hack to reconfigure and change the URL. This is needed until we
have a JMX HTML Adapter that can use PropertyEditor to coerce.
Parameters: url - The new configuration url |
setCatchSystemErr | public void setCatchSystemErr(boolean flag)(Code) | | Set the catch System.err flag.
Parameters: flag - True to enable, false to disable. |
setCatchSystemOut | public void setCatchSystemOut(boolean flag)(Code) | | Set the catch System.out flag.
Parameters: flag - True to enable, false to disable. |
setConfigurationURL | public void setConfigurationURL(URL url)(Code) | | Set the Log4j configuration URL.
|
setLog4jQuietMode | public void setLog4jQuietMode(boolean flag)(Code) | | Set the org.apache.log4j.helpers.LogLog.setQuietMode flag
True if enabled, false if disabled. |
setLoggerLevel | public void setLoggerLevel(String name, String levelName)(Code) | | Sets the level for a logger of the give name.
Values are trimmed before used.
Parameters: name - The name of the logger to change level Parameters: levelName - The name of the level to change the logger to. |
setLoggerLevels | public void setLoggerLevels(String list, String levelName)(Code) | | Sets the levels of each logger specified by the given comma
seperated list of logger names.
See Also: Log4jService.setLoggerLevel Parameters: list - A comma seperated list of logger names. Parameters: levelName - The name of the level to change the logger to. |
setRefreshPeriod | public void setRefreshPeriod(int refreshPeriod)(Code) | | Set the refresh period.
|
|
|