Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Apache Commons Logging LogFactory.getLog() Method
How to use LogFactory.getLog() method to create a Log object in Apache Commons Logging API?
✍: FYIcenter.com
The simplest way to create a Log object
is to call the static method LogFactory.getLog()
and let the Apache Commons Logging API to decide
which actual logging system to use.
For example, if you call LogFactory.getLog("MyLog"), Apache Commons Logging API will use the following rules to determine which logging system to use:
Rule 1. If commons-logging.properties file is specified in the class path and it has the org.apache.commons.logging.Log=SomeLoggerClass setting, SomeLoggerClass will be used as the logger.
Rule 2. Else if system property org.apache.commons.logging.Log=SomeLoggerClass is provided, SomeLoggerClass will be used as the logger.
Rule 3. Else if log4j.properties file is specified in the class path, org.apache.commons.logging.impl.Log4JLogger will be used as the logger.
Rule 4. Else if the running JVM is 1.4 or higher, org.apache.commons.logging.impl.Jdk14Logger will be used as the logger.
Rule 5. Else org.apache.commons.logging.impl.SimpleLog will be used as the logger.
⇒ Example of Default Apache Commons Logging
⇐ What is Apache Commons Logging API and Bridges?
2017-05-29, 2818🔥, 0💬
Popular Posts:
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...
How to download and install ojdbc6.jar for Oracle 11g R2? ojdbc6.jar for Oracle 11g R2 is a Java 6, ...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
What Is mail.jar of JavaMail 1.4.2? I got the JAR file from javamail-1.4.2.zip. mail.jar in javamail...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...