Questions about the time format in Java.util.logging.Logger usage

Source: Internet
Author: User
The Java.util.logging.Logger class can print related log information and write log information to a log file

TOMCAT7 default log format output method is Java.util.logging.SimpleFormatter.format such as: APR one, 2018 4:11:48 PM

TOMCAT8 the default log format output method is org.apache.juli.OneLineFormatter such as: 12-apr-2018 15:52:41.446

"Logging.properties", the property file exists under the/jre/lib folder under Java_home, you can modify the related configuration

Like "Yyyy-mm-dd HH:mm:ss" Such a time format, then modify the properties file, add the following sentence:

JAVA.UTIL.LOGGING.SIMPLEFORMATTER.FORMAT=%1$TF%1$th:%1$tm:%1$ts%2$s%n%4$s:%5$s%6$s%n

Note: If you do not have this sentence, the TOMCAT7 default format for Simpleformatter is: "%1$tb%1$td,%1$ty%1$tl:%1$tm:%1$ts%1$tp%2$s%n%4$s:%5$s%6$s%n ";

Questions about the time format in Java.util.logging.Logger usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.