Java Doc for LogSource.java in  » Library » apache-common-Logging » org » apache » commons » 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 » Library » apache common Logging » org.apache.commons.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.logging.LogSource

LogSource
public class LogSource (Code)

Factory for creating Log instances. Applications should call the makeNewLogInstance() method to instantiate new instances of the configured Log implementation class.

By default, calling getInstance() will use the following algorithm:

  • If Log4J is available, return an instance of org.apache.commons.logging.impl.Log4JLogger.
  • If JDK 1.4 or later is available, return an instance of org.apache.commons.logging.impl.Jdk14Logger.
  • Otherwise, return an instance of org.apache.commons.logging.impl.NoOpLog.

You can change the default behavior in one of two ways:

  • On the startup command line, set the system property org.apache.commons.logging.log to the name of the org.apache.commons.logging.Log implementation class you want to use.
  • At runtime, call LogSource.setLogImplementation().
LogFactory
author:
   Rod Waldhoff
version:
   $Id: LogSource.java 155426 2005-02-26 13:10:49Z dirkv $


Field Summary
protected static  booleanjdk14IsAvailable
    
protected static  booleanlog4jIsAvailable
    
protected static  ConstructorlogImplctor
    
protected static  Hashtablelogs
    


Method Summary
public static  LoggetInstance(String name)
    
public static  LoggetInstance(Class clazz)
    
public static  String[]getLogNames()
     Returns a String array containing the names of all logs known to me.
public static  LogmakeNewLogInstance(String name)
     Create a new Log implementation, based on the given name.

The specific Log implementation returned is determined by the value of the org.apache.commons.logging.log property. The value of org.apache.commons.logging.log may be set to the fully specified name of a class that implements the Log interface.

public static  voidsetLogImplementation(String classname)
     Set the log implementation/log implementation factory by the name of the class.
public static  voidsetLogImplementation(Class logclass)
     Set the log implementation/log implementation factory by class.

Field Detail
jdk14IsAvailable
protected static boolean jdk14IsAvailable(Code)
Is JDK 1.4 logging available



log4jIsAvailable
protected static boolean log4jIsAvailable(Code)
Is log4j available (in the current classpath)



logImplctor
protected static Constructor logImplctor(Code)
Constructor for current log class



logs
protected static Hashtable logs(Code)





Method Detail
getInstance
public static Log getInstance(String name)(Code)
Get a Log instance by class name



getInstance
public static Log getInstance(Class clazz)(Code)
Get a Log instance by class



getLogNames
public static String[] getLogNames()(Code)
Returns a String array containing the names of all logs known to me.



makeNewLogInstance
public static Log makeNewLogInstance(String name)(Code)
Create a new Log implementation, based on the given name.

The specific Log implementation returned is determined by the value of the org.apache.commons.logging.log property. The value of org.apache.commons.logging.log may be set to the fully specified name of a class that implements the Log interface. This class must also have a public constructor that takes a single String argument (containing the name of the Log to be constructed.

When org.apache.commons.logging.log is not set, or when no corresponding class can be found, this method will return a Log4JLogger if the log4j Logger class is available in the LogSource 's classpath, or a Jdk14Logger if we are on a JDK 1.4 or later system, or NoOpLog if neither of the above conditions is true.
Parameters:
  name - the log name (or category)




setLogImplementation
public static void setLogImplementation(String classname) throws LinkageError, ExceptionInInitializerError, NoSuchMethodException, SecurityException, ClassNotFoundException(Code)
Set the log implementation/log implementation factory by the name of the class. The given class must implement Log , and provide a constructor that takes a single String argument (containing the name of the log).



setLogImplementation
public static void setLogImplementation(Class logclass) throws LinkageError, ExceptionInInitializerError, NoSuchMethodException, SecurityException(Code)
Set the log implementation/log implementation factory by class. The given class must implement Log , and provide a constructor that takes a single String argument (containing the name of the log).



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.