Java Doc for Logging.java in  » GIS » GeoTools-2.4.1 » org » geotools » util » 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 » GIS » GeoTools 2.4.1 » org.geotools.util.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.util.logging.Logging

Logging
final public class Logging (Code)
A set of utilities method for configuring loggings in GeoTools. All GeoTools code should fetch their logger through a call to Logging.getLogger(String) , not Logger.getLogger(String) . This is necessary in order to give GeoTools a chance to redirect log events to an other logging framework, for example commons-logging.

Example: In order to redirect every GeoTools log events to Commons-logging, invoke the following once at application startup:

Logging. . ("org.geotools.util.logging.CommonsLoggerFactory");

since:
   2.4
version:
   $Id: Logging.java 27891 2007-11-14 14:10:48Z desruisseaux $
author:
   Martin Desruisseaux


Field Summary
final public static  LoggingALL
     Logging configuration that apply to all packages.
final public static  LoggingGEOTOOLS
     Logging configuration that apply only to GeoTools packages.
final  Stringname
     The name of the base package.


Method Summary
public  voidforceMonolineConsoleOutput()
     Configures the default in order to log records on a single line instead of two lines.
public  voidforceMonolineConsoleOutput(Level level)
     Same as Logging.forceMonolineConsoleOutput() , but additionnaly set an optional logging level.
public static  LoggergetLogger(String name)
     Returns a logger for the specified name.
public  LoggerFactorygetLoggerFactory()
     Returns the logger factory, or null if none.
public static  LogginggetLogging(String name)
     Returns a Logging instance for the specified base logger.
public  voidsetLoggerFactory(LoggerFactory factory)
     Sets a new logger factory for this Logging instance and every children.
public  voidsetLoggerFactory(String className)
     Sets a new logger factory from a fully qualidifed class name.
public static  booleanunexpectedException(Logger logger, Throwable error)
     Invoked when an unexpected error occurs.
public static  voidunexpectedException(Logger logger, Class classe, String method, Throwable error)
     Invoked when an unexpected error occurs.
public static  voidunexpectedException(String paquet, Class classe, String method, Throwable error)
     Invoked when an unexpected error occurs.

Field Detail
ALL
final public static Logging ALL(Code)
Logging configuration that apply to all packages.



GEOTOOLS
final public static Logging GEOTOOLS(Code)
Logging configuration that apply only to GeoTools packages.



name
final String name(Code)
The name of the base package.





Method Detail
forceMonolineConsoleOutput
public void forceMonolineConsoleOutput()(Code)
Configures the default in order to log records on a single line instead of two lines. More specifically, for each java.util.logging.ConsoleHandler using a java.util.logging.SimpleFormatter , this method replaces the simple formatter by an instance of MonolineFormatter . If no ConsoleHandler are found, then a new one is created.

Note: this method may have no effect if the loggings are redirected to an other logging framework, for example if Logging.redirectToCommonsLogging has been invoked.




forceMonolineConsoleOutput
public void forceMonolineConsoleOutput(Level level)(Code)
Same as Logging.forceMonolineConsoleOutput() , but additionnaly set an optional logging level. If the specified level is non-null, then all java.util.logging.Handler s using the monoline formatter will be set to the specified level.

Note: Avoid this method as much as possible, since it overrides user's level setting. A user trying to configure his logging properties may find confusing to see his setting ignored.
See Also:   org.geotools.factory.GeoTools.init




getLogger
public static Logger getLogger(String name)(Code)
Returns a logger for the specified name. If a has been set, then this method first . It gives GeoTools a chance to redirect logging events to commons-logging or some equivalent framework.

If no factory was found or if the factory choose to not redirect the loggings, then this method returns the usual (name).
Parameters:
  name - The logger name. A logger for the specified name.




getLoggerFactory
public LoggerFactory getLoggerFactory()(Code)
Returns the logger factory, or null if none. This method returns the logger set by the last call to Logging.setLoggerFactory on this Logging instance or on one of its parent.



getLogging
public static Logging getLogging(String name)(Code)
Returns a Logging instance for the specified base logger. This instance is used for controlling logging configuration in GeoTools. For example methods like Logging.forceMonolineConsoleOutput are invoked on a Logging instance.

Logging instances follow the same hierarchy than Logger , i.e. "org.geotools" is the parent of "org.geotools.referencing" , "org.geotools.metadata" , etc.
Parameters:
  name - The base logger name.




setLoggerFactory
public void setLoggerFactory(LoggerFactory factory)(Code)
Sets a new logger factory for this Logging instance and every children. The specified factory will be used by (name) when name is this Logging name or one of its children.



setLoggerFactory
public void setLoggerFactory(String className) throws ClassNotFoundException, IllegalArgumentException(Code)
Sets a new logger factory from a fully qualidifed class name. This method should be preferred to Logging.setLoggerFactory(LoggerFactory) when the underlying logging framework is not garanteed to be on the classpath.
Parameters:
  className - The fully qualified factory class name.
throws:
  ClassNotFoundException - if the specified class was not found.
throws:
  IllegalArgumentException - if the specified class is not a subclass ofLoggerFactory, or if no public static getInstance() methodhas been found or can be executed.



unexpectedException
public static boolean unexpectedException(Logger logger, Throwable error)(Code)
Invoked when an unexpected error occurs. This method logs a message at the Level.WARNING WARNING level to the specified logger. The originating class name and method name are inferred from the error stack trace, using the first for which the class name is inside a package or sub-package of the logger name. For example if the logger name is "org.geotools.image" , then this method will uses the first stack trace element where the fully qualified class name starts with "org.geotools.image" or "org.geotools.image.io" , but not "org.geotools.imageio" .
Parameters:
  logger - Where to log the error.
Parameters:
  error - The error that occured. true if the error has been logged, or false if the loggerdoesn't log anything at the Level.WARNING WARNING level.



unexpectedException
public static void unexpectedException(Logger logger, Class classe, String method, Throwable error)(Code)
Invoked when an unexpected error occurs. This method logs a message at the Level.WARNING WARNING level to the specified logger. The originating class name and method name can optionnaly be specified. If any of them is null , then it will be inferred from the error stack trace as in Logging.unexpectedException(Logger,Throwable) .

Explicit value for class and method names are sometime preferred to automatic inference for the following reasons:

  • Automatic inference is not 100% reliable, since the Java Virtual Machine is free to omit stack frame in optimized code.

  • When an exception occured in a private method used internally by a public method, we sometime want to log the warning for the public method instead, since the user is not expected to know anything about the existence of the private method. If a developper really want to know about the private method, the stack trace is still available anyway.


Parameters:
  logger - Where to log the error.
Parameters:
  classe - The class where the error occurred, or null .
Parameters:
  method - The method where the error occurred, or null .
Parameters:
  error - The error.



unexpectedException
public static void unexpectedException(String paquet, Class classe, String method, Throwable error)(Code)
Invoked when an unexpected error occurs. This method logs a message at the Level.WARNING WARNING level to the logger for the specified package name. The originating class name and method name can optionnaly be specified. If any of them is null , then it will be inferred from the error stack trace as in Logging.unexpectedException(Logger,Throwable) .
Parameters:
  paquet - The package where the error occurred, or null . Thisinformation is used for fetching an appropriate Loggerfor logging the error.
Parameters:
  classe - The class where the error occurred, or null .
Parameters:
  method - The method where the error occurred, or null .
Parameters:
  error - The error.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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