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:
SimpleLog Logger and simplelog.properties File
How to use SimpleLog Logger and simplelog.properties File?
✍: FYIcenter.com
The suggested way to use the SimpleLog Logger and simplelog.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.SimpleLog
2.Create simplelog.properties file:
# simplelog.properties # Copyright (c) 2016 FYIcenter.com # Show timestampe in the log org.apache.commons.logging.simplelog.showdatetime=true # Use the format for timestamp org.apache.commons.logging.simplelog.dateTimeFormat=yyyy-MM-dd'T'HH:mm:ss.SSSZ # Show logger instance name org.apache.commons.logging.simplelog.showShortLogname=true # Set level to "trace" on "MyLogging" instance org.apache.commons.logging.simplelog.log.MyLogging=trace # Set level to "warn" on all other log instances org.apache.commons.logging.simplelog.defaultlog=warn
3. Run the HelloCommonsLogging example code with both properties files in the current folder, which is included in the class path:
C:\fyicenter>java -cp .;C:\local\commons-logging-1.2\commons-logging-1.2.jar HelloCommonsLogging Log class: org.apache.commons.logging.impl.SimpleLog 2016-11-13T22:57:01.895-0500 [FATAL] MyLogging - Hello - fatal 2016-11-13T22:57:01.895-0500 [ERROR] MyLogging - Hello - error 2016-11-13T22:57:01.895-0500 [WARN] MyLogging - Hello - warn 2016-11-13T22:57:01.895-0500 [INFO] MyLogging - Hello - info 2016-11-13T22:57:01.895-0500 [DEBUG] MyLogging - Hello - debug 2016-11-13T22:57:01.895-0500 [TRACE] MyLogging - Hello - trace
⇒ Jdk14Logger Logger and logging.properties File
⇐ What Is commons-logging.properties File?
2016-11-16, 4182🔥, 0💬
Popular Posts:
maven-compat-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Compact module. The JAR file name may ...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
What Is ojdbc5.jar for Oracle 11g R1? ojdbc5.jar for Oracle 11g R1 is the JAR files of ojdbc.jar, JD...
JDK 11 java.rmi.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) module. JDK 11 RMI m...
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...