Java Doc for Logger.java in  » Science » Cougaar12_4 » org » cougaar » util » log » 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 » Science » Cougaar12_4 » org.cougaar.util.log 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.cougaar.util.log.Logger

All known Subclasses:   org.cougaar.util.log.LoggerAdapter,
Logger
public interface Logger (Code)
The Logger provides a generic logging API.

This provides the basic:

 if (log.isDebugEnabled()) {
 log.debug("my message");
 }
 
and related logging methods.

This API is a subset of the "log4j" API, but the underlying implementation may use a different logger, such as "jsr47".

Note that (currently) the Logger user is unable to alter the underlying logger's threshold level. A separate LoggerController must be used to make such modifications.

An enhancement idea is to allow a Logger user to alter this level -- for example, this could be used to increase logging detail when an error is deteted. For now the equivalent behavior can be obtained by using "log(level, ..)" and selecting the "level" value at runtime.



Field Summary
 intDEBUG
    
 intDETAIL
     Generic logging levels.

The value of these constants may be modified in the future without notice.

 intERROR
    
 intFATAL
    
 intINFO
    
 intSHOUT
    
 intWARN
    


Method Summary
 voiddebug(String message)
     Equivalent to "log(DEBUG, ..)".
 voiddebug(String message, Throwable t)
    
 voiddetail(String message)
     Equivalent to "log(DETAIL, ..)".
 voiddetail(String message, Throwable t)
    
 voiderror(String message)
     Equivalent to "log(ERROR, ..)".
 voiderror(String message, Throwable t)
    
 voidfatal(String message)
     Equivalent to "log(FATAL, ..)".
 voidfatal(String message, Throwable t)
    
 voidinfo(String message)
     Equivalent to "log(INFO, ..)".
 voidinfo(String message, Throwable t)
    
 booleanisDebugEnabled()
    
 booleanisDetailEnabled()
    
 booleanisEnabledFor(int level)
     Logger users should check "isEnabledFor(..)" before requesting a log message, to prevent unnecessary string creation.

 When the log message requires constructing a String (e.g.
 by using "+", or by calculating some value), then the
 "is*Enabled(..)" check is preferred.
 booleanisErrorEnabled()
    
 booleanisFatalEnabled()
    
 booleanisInfoEnabled()
    
 booleanisShoutEnabled()
    
 booleanisWarnEnabled()
    
 voidlog(int level, String message)
     Append the specified message to the log, but only if the logger includes the specified logging level.
 voidlog(int level, String message, Throwable t)
     Append both specified message and throwable to the log, but only if the logger includes the specified logging level.

If the throwable is null then this is equivalent to:

 log(level, message).

Parameters:
  level - the required logging level (DEBUG, WARN, etc)
Parameters:
  message - the string to log
Parameters:
  t - the throwable (e.g.
 voidprintDot(String dot)
    
 voidshout(String message)
     Equivalent to "log(SHOUT, ..)".
 voidshout(String message, Throwable t)
    
 voidwarn(String message)
     Equivalent to "log(WARN, ..)".
 voidwarn(String message, Throwable t)
    

Field Detail
DEBUG
int DEBUG(Code)



DETAIL
int DETAIL(Code)
Generic logging levels.

The value of these constants may be modified in the future without notice. For example, "DEBUG" may be changed from "1" to some other integer constant. However, the ordering of:

 DETAIL < DEBUG < INFO < WARN < ERROR < SHOUT < FATAL
 

is guaranteed.



ERROR
int ERROR(Code)



FATAL
int FATAL(Code)



INFO
int INFO(Code)



SHOUT
int SHOUT(Code)



WARN
int WARN(Code)





Method Detail
debug
void debug(String message)(Code)
Equivalent to "log(DEBUG, ..)".



debug
void debug(String message, Throwable t)(Code)



detail
void detail(String message)(Code)
Equivalent to "log(DETAIL, ..)".



detail
void detail(String message, Throwable t)(Code)



error
void error(String message)(Code)
Equivalent to "log(ERROR, ..)".



error
void error(String message, Throwable t)(Code)



fatal
void fatal(String message)(Code)
Equivalent to "log(FATAL, ..)".



fatal
void fatal(String message, Throwable t)(Code)



info
void info(String message)(Code)
Equivalent to "log(INFO, ..)".



info
void info(String message, Throwable t)(Code)



isDebugEnabled
boolean isDebugEnabled()(Code)



isDetailEnabled
boolean isDetailEnabled()(Code)



isEnabledFor
boolean isEnabledFor(int level)(Code)
Logger users should check "isEnabledFor(..)" before requesting a log message, to prevent unnecessary string creation.

 When the log message requires constructing a String (e.g.
 by using "+", or by calculating some value), then the
 "is*Enabled(..)" check is preferred.  For example:
 if (isDebugEnabled()) {
 debug("good, this message will be logged, "+someArg);
 }
 is prefered to:
 debug("maybe this will be logged, maybe wasteful, "+someArg);
 The one exception is when the message is a constant string,
 in which case the "is*Enabled(..)" check is unnecessary. 
 For example:
 debug("a constant string is okay");
 is just as good as:
 if (isDebugEnabled()) {
 debug("isDebug check not needed, but harmless");
 }
 However, developers often modify their logging statements,
 so it's best to always use the "is*Enabled(..)" pattern.
 

Although this seems like a minor point, these string allocations can add up to a potentially large (and needless) performance penalty when the logging level is turned down.
Parameters:
  level - a logging level, such as DEBUG




isErrorEnabled
boolean isErrorEnabled()(Code)



isFatalEnabled
boolean isFatalEnabled()(Code)



isInfoEnabled
boolean isInfoEnabled()(Code)



isShoutEnabled
boolean isShoutEnabled()(Code)



isWarnEnabled
boolean isWarnEnabled()(Code)



log
void log(int level, String message)(Code)
Append the specified message to the log, but only if the logger includes the specified logging level.
Parameters:
  level - the required logging level (DEBUG, WARN, etc)
Parameters:
  message - the string to log
See Also:   Logger.isEnabledFor(int)



log
void log(int level, String message, Throwable t)(Code)
Append both specified message and throwable to the log, but only if the logger includes the specified logging level.

If the throwable is null then this is equivalent to:

 log(level, message).

Parameters:
  level - the required logging level (DEBUG, WARN, etc)
Parameters:
  message - the string to log
Parameters:
  t - the throwable (e.g. RuntimeException) that is related to the message
See Also:   Logger.isEnabledFor(int)



printDot
void printDot(String dot)(Code)



shout
void shout(String message)(Code)
Equivalent to "log(SHOUT, ..)".



shout
void shout(String message, Throwable t)(Code)



warn
void warn(String message)(Code)
Equivalent to "log(WARN, ..)".



warn
void warn(String message, Throwable t)(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.