Java Doc for MonologCategory.java in  » Development » Monolog » org » objectweb » util » monolog » wrapper » log4j » 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 » Development » Monolog » org.objectweb.util.monolog.wrapper.log4j 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.objectweb.util.monolog.wrapper.log4j.MonologCategory

MonologCategory
public class MonologCategory extends org.apache.log4j.Logger implements TopicalLogger(Code)
This class wraps the Logger concept into the log4j world. This class extends therefore the Logger class. This implementation supports
  • The multiple topic feature by adding a parent list into each node.
  • The inheritance model: The same instance represents the monolog aspect (Logger) and the Log4j aspect (Logger).
  • The delegation model: There are two instances, a Logger object (or a class which inherits from Logger as RootLogger), and a MonologCategory which delegates calls to the first objects.

author:
   Sebastien Chassande-Barrioz

Inner Class :public static class OwPriority extends org.apache.log4j.Level
Inner Class :public static class BetaCF implements org.apache.log4j.spi.LoggerFactory

Field Summary
final protected static  intDISABLE_OFF
    
final protected static  intDISABLE_ON
    
protected  ArrayListappenders
    
protected  org.apache.log4j.Loggercateg
     This field references the inner Logger if the delegation was choosen.
protected  bytedepth
    
protected  booleanenable
    
protected  OwPriorityinterPriority
    
protected  HashMaptopicToparents
     This field references all parent of this Logger. key = topic of the current logger value = its parent either the topic.

Constructor Summary
public  MonologCategory(String _initialName)
     This constructor initializes the instance in inheritance mode.
public  MonologCategory(org.apache.log4j.Logger c)
     This constructor initializes the instance in delegation mode.
Parameters:
  c - is the inner Logger.

Method Summary
public  voidaddHandler(Handler h)
    
public  voidaddTopic(String topic)
    
public  voidcallAppenders(LoggingEvent event)
     In inheritance mode this method delegates the treatment to the other callAppendes methods.
public synchronized  booleancallAppenders(LoggingEvent event, boolean called)
     This method calls all the parent loggers and call its appender either the followin condition:
  • if the called parameter is equals to true then all parent are call with the same value, and the logging event are transmitted to the appenders.
public static  Stringformat(String msg, int removeTopStack)
     It formats a message by adding the object and the method name where the call to monolog was done.
Parameters:
  msg - is the original message
Parameters:
  removeTopStack - is the number of monolog method call.
public  ObjectgetAttribute(String name)
    
public  String[]getAttributeNames()
    
public  org.apache.log4j.LevelgetChainedLevel()
     Starting from this Logger, search the Logger hierarchy for a non-null priority and return it.
public  intgetCurrentIntLevel()
    
public  LevelgetCurrentLevel()
    
public  Handler[]getHandler()
    
public  HandlergetHandler(String hn)
    
public  String[]getTopic()
    
public  EnumerationgetTopics()
    
public  StringgetType()
    
public  booleanisLoggable(int l)
    
public  booleanisLoggable(Level l)
    
public  booleanisOn()
    
public  voidlog(int l, Object o)
     Log an object with a specific level.
public  voidlog(Level l, Object o)
    
public  voidlog(int l, Object o, Throwable t)
     Log an object and a trowable with a specific level.
public  voidlog(Level l, Object o, Throwable t)
    
public  voidlog(int l, Object o, Object location, Object method)
     Log an object and a trowable with a specific level.
public  voidlog(Level l, Object o, Object location, Object method)
    
public  voidlog(int l, Object o, Throwable t, Object location, Object method)
     Log an object and a trowable with a specific level.
public  voidlog(Level l, Object o, Throwable t, Object location, Object method)
    
public  voidremoveAllHandlers()
    
public  voidremoveHandler(Handler h)
    
public  voidremoveTopic(String topic)
    
public  ObjectsetAttribute(String name, Object value)
    
public  voidsetIntLevel(int level)
    
public  voidsetLevel(Level l)
    
public  voidsetName(String n)
    
public  voidturnOff()
    
public  voidturnOn()
    

Field Detail
DISABLE_OFF
final protected static int DISABLE_OFF(Code)



DISABLE_ON
final protected static int DISABLE_ON(Code)



appenders
protected ArrayList appenders(Code)
This field references all appenders associated to the current Logger



categ
protected org.apache.log4j.Logger categ(Code)
This field references the inner Logger if the delegation was choosen.



depth
protected byte depth(Code)



enable
protected boolean enable(Code)



interPriority
protected OwPriority interPriority(Code)



topicToparents
protected HashMap topicToparents(Code)
This field references all parent of this Logger. key = topic of the current logger value = its parent either the topic. A parent can be a MonologCategory or a Logger.




Constructor Detail
MonologCategory
public MonologCategory(String _initialName)(Code)
This constructor initializes the instance in inheritance mode. It initializes the instanceFQN, and struture of parents.



MonologCategory
public MonologCategory(org.apache.log4j.Logger c)(Code)
This constructor initializes the instance in delegation mode.
Parameters:
  c - is the inner Logger. All calls will be foward to this instance




Method Detail
addHandler
public void addHandler(Handler h) throws Exception(Code)
Add a handler in the Handler list of the topicalLogger



addTopic
public void addTopic(String topic) throws Exception(Code)
Add a topic to the topicalLogger



callAppenders
public void callAppenders(LoggingEvent event)(Code)
In inheritance mode this method delegates the treatment to the other callAppendes methods. In delegation mode, the call is forwarded on the inner Logger instance.



callAppenders
public synchronized boolean callAppenders(LoggingEvent event, boolean called)(Code)
This method calls all the parent loggers and call its appender either the followin condition:
  • if the called parameter is equals to true then all parent are call with the same value, and the logging event are transmitted to the appenders. The true is return beacause the event must be transmitted
  • Or if the current priority is define and the message priority is equals or greater then the current priority then all parent are call with the same value, and the logging event are transmitted to the appenders. The true is return beacause the event must be transmitted
  • Else It is needed to check one of the parent is enable for the logging event. This is done by the recall of each parent. If one of the parent return true, then the event must be logged.

Parameters:
  event - is the logging event
Parameters:
  called - is the boolean which permits to know if the current logger mustcall or not its appender without check its priority.return true is the logging event is enabled in the current logger or oneof its ancestors.



format
public static String format(String msg, int removeTopStack)(Code)
It formats a message by adding the object and the method name where the call to monolog was done.
Parameters:
  msg - is the original message
Parameters:
  removeTopStack - is the number of monolog method call. Indeed this methodfetch a stack trace. This method fetches one line in this stack. Theparameter is the line number in this stack.



getAttribute
public Object getAttribute(String name)(Code)



getAttributeNames
public String[] getAttributeNames()(Code)



getChainedLevel
public org.apache.log4j.Level getChainedLevel()(Code)
Starting from this Logger, search the Logger hierarchy for a non-null priority and return it. Otherwise, return the priority of the root Logger.

The Logger class is designed so that this method executes as quickly as possible.




getCurrentIntLevel
public int getCurrentIntLevel()(Code)
Return the current Level of the logger



getCurrentLevel
public Level getCurrentLevel()(Code)



getHandler
public Handler[] getHandler()(Code)



getHandler
public Handler getHandler(String hn)(Code)



getTopic
public String[] getTopic()(Code)
Returns the list of the different names of the topicalLogger



getTopics
public Enumeration getTopics()(Code)
Returns the list of the different names of the topicalLogger



getType
public String getType()(Code)



isLoggable
public boolean isLoggable(int l)(Code)
Check if the level parameter are not filtered by the logger



isLoggable
public boolean isLoggable(Level l)(Code)



isOn
public boolean isOn()(Code)
Is the handler enabled



log
public void log(int l, Object o)(Code)
Log an object with a specific level. If the level parameter is loggable the object is handled.



log
public void log(Level l, Object o)(Code)



log
public void log(int l, Object o, Throwable t)(Code)
Log an object and a trowable with a specific level.



log
public void log(Level l, Object o, Throwable t)(Code)



log
public void log(int l, Object o, Object location, Object method)(Code)
Log an object and a trowable with a specific level. This method permits to specify an object instance and a method.



log
public void log(Level l, Object o, Object location, Object method)(Code)



log
public void log(int l, Object o, Throwable t, Object location, Object method)(Code)
Log an object and a trowable with a specific level. This method permits to specify an object instance and a method.



log
public void log(Level l, Object o, Throwable t, Object location, Object method)(Code)



removeAllHandlers
public void removeAllHandlers() throws Exception(Code)



removeHandler
public void removeHandler(Handler h) throws Exception(Code)
Remove a handler from the Handler list of the topicalLogger



removeTopic
public void removeTopic(String topic) throws Exception(Code)
Remove a topic from the topicalLogger



setAttribute
public Object setAttribute(String name, Object value)(Code)



setIntLevel
public void setIntLevel(int level)(Code)
Set the current level of the logger



setLevel
public void setLevel(Level l)(Code)



setName
public void setName(String n)(Code)



turnOff
public void turnOff()(Code)
Disable the handler



turnOn
public void turnOn()(Code)
Enable the handler



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