Spring Boot默认的日志格式

在做新项目的时候,发现Spring Boot默认的日志格式还挺好看的,就把他的日志格式整理出来,好留着在以后自定义日志的时候可以使用。

pattern:

%d{yyyy-MM-dd HH:mm:ss.SSS} -%5p ${PID:-} [%15.15t] %-40.40logger{39} : %m%n

效果如下:

2016-08-03 15:56:01.387 - INFO 1485 [           main] com.mia.files.UploadApplication          : Starting UploadApplication on localhost with PID 1485 (/Users/lipangeng/Documents/Developer/WorkSpace/Java/file-upload-java/target/classes started by lipangeng in /Users/lipangeng/Documents/Developer/WorkSpace/Java/file-upload-java)
2016-08-03 15:56:01.394 - INFO 1485 [           main] com.mia.files.UploadApplication          : No active profile set, falling back to default profiles: default
2016-08-03 15:56:01.484 - INFO 1485 [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@b978d10: startup date [Wed Aug 03 15:56:01 CST 2016]; root of context hierarchy
2016-08-03 15:56:01.706 - INFO 1485 [kground-preinit] o.h.validator.internal.util.Version      : HV000001: Hibernate Validator 5.2.4.Final
2016-08-03 15:56:02.714 - INFO 1485 [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 12000 (http)
2016-08-03 15:56:02.724 - INFO 1485 [           main] o.apache.catalina.core.StandardService   : Starting service Tomcat
2016-08-03 15:56:02.725 - INFO 1485 [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.4
2016-08-03 15:56:02.805 - INFO 1485 [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2016-08-03 15:56:02.805 - INFO 1485 [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1321 ms
2016-08-03 15:56:02.916 - INFO 1485 [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2016-08-03 15:56:02.920 - INFO 1485 [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-08-03 15:56:02.920 - INFO 1485 [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-08-03 15:56:02.920 - INFO 1485 [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-08-03 15:56:02.920 - INFO 1485 [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]

你可能感兴趣的:(Spring,springboot,logback,slf4j)