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:
Jdk14Logger Logger and logging.properties File
How to use Jdk14Logger Logger and logging.properties File?
✍: FYIcenter.com
The suggested way to use the Jdk14Logger Logger and logging.properties File
is to do the following:
1.Create commons-logging.properties file with one entry:
# commons-logging.properties org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
2.Create logging.properties file:
# logging.properties # Copyright (c) 2016 FYIcenter.com # Which handler to use handlers=java.util.logging.ConsoleHandler # Logging levels: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST java.util.logging.ConsoleHandler.level=FINEST # Logging format java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s (%2$s) %5$s %6$s%n
3. Make sure you are using JDK 1.4 and JVM 1.4 or newer versions.
4. Run the HelloCommonsLogging example code with both properties files in the current folder. The first will be picked by the class path. The second will be specified in a system property:
C:\fyicenter>java -cp .;C:\local\commons-logging-1.2\commons-logging-1.2.jar "-Djava.util.logging.config.file=logging.properties" HelloCommonsLogging Log class: org.apache.commons.logging.impl.Jdk14Logger 2016-11-13 22:32:20.645 SEVERE (MyLogging main) Hello - fatal 2016-11-13 22:32:20.677 SEVERE (MyLogging main) Hello - error 2016-11-13 22:32:20.678 WARNING (MyLogging main) Hello - warn 2016-11-13 22:32:20.679 INFO (MyLogging main) Hello - info
Note that Apache Commons Logging log.debug() and log.trace() methods seem to be not compatible with JDK 1.4 Logger. "Hello - debug" and "Hello - trace" log entries did not show up even the logging level is set to FINEST.
⇒ Log4JLogger Logger and log4j.properties File
⇐ SimpleLog Logger and simplelog.properties File
2016-11-16, 5084🔥, 0💬
Popular Posts:
What Is javamail1_1_3.zip? javamail1_1_3.zip is the binary package of JavaMail API 1.1.3 in ZIP form...
JRE 8 plugin.jar is the JAR file for JRE 8 Java Control Panel Plugin interface and tools. JRE (Java ...
Commons Pool provides an Object-pooling API, with three major aspects: 1. A generic object pool inte...
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...