Java Doc for Log4jService.java in  » EJB-Server-JBoss-4.2.1 » server » org » jboss » logging » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server JBoss 4.2.1 » server » org.jboss.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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  booleanCATCH_SYSTEM_ERR
     Default flag to enable/disable cacthing System.err.
final public static  booleanCATCH_SYSTEM_OUT
     Default flag to enable/disable cacthing System.out.
final public static  StringDEFAULT_URL
     The default url for the configuration file.

Constructor Summary
public  Log4jService()
     Uses defaults.
public  Log4jService(URL url)
    
public  Log4jService(String url)
    
public  Log4jService(String url, int refreshPeriod)
    
public  Log4jService(URL url, int refreshPeriod)
    

Method Summary
protected  voidcreateService()
    
protected  voidemitReconfigureNotification()
    
public  booleangetCatchSystemErr()
     Get the catch System.err flag.
public  booleangetCatchSystemOut()
     Get the catch System.out flag.
public  URLgetConfigurationURL()
     Get the Log4j configuration URL.
public  booleangetLog4jQuietMode()
    
public  StringgetLoggerLevel(String name)
     Gets the level of the logger of the give name.
protected  ObjectNamegetObjectName(MBeanServer server, ObjectName name)
    
public  intgetRefreshPeriod()
     Get the refresh period.
public  voidreconfigure()
     Force the logging system to reconfigure.
public  voidreconfigure(String url)
     Hack to reconfigure and change the URL.
public  voidsetCatchSystemErr(boolean flag)
     Set the catch System.err flag.
public  voidsetCatchSystemOut(boolean flag)
     Set the catch System.out flag.
public  voidsetConfigurationURL(URL url)
     Set the Log4j configuration URL.
public  voidsetLog4jQuietMode(boolean flag)
    
public  voidsetLoggerLevel(String name, String levelName)
     Sets the level for a logger of the give name.
public  voidsetLoggerLevels(String list, String levelName)
     Sets the levels of each logger specified by the given comma seperated list of logger names.
public  voidsetRefreshPeriod(int refreshPeriod)
     Set the refresh period.
protected  voidstartService()
    
protected  voidstopService()
    

Field Detail
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.




Constructor Detail
Log4jService
public Log4jService() throws MalformedURLException(Code)
Uses defaults.
throws:
  MalformedURLException - Could not create URL from default (propbablya problem with overridden properties).



Log4jService
public Log4jService(URL url)(Code)

Parameters:
  url - The configuration URL.



Log4jService
public Log4jService(String url) throws MalformedURLException(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.




Method Detail
createService
protected void createService() throws Exception(Code)



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.



getObjectName
protected ObjectName getObjectName(MBeanServer server, ObjectName name) throws MalformedObjectNameException(Code)



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.



startService
protected void startService() throws Exception(Code)



stopService
protected void stopService() throws Exception(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.