mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-08-14 05:21:42 +08:00
Compare commits
No commits in common. "35417ec719ad513c1adaded86f30dc82c580d1b5" and "681c5aeef7b66f33a79a83a943b172b2493d9ac6" have entirely different histories.
35417ec719
...
681c5aeef7
@ -48,7 +48,7 @@ SPI 将服务接口和具体的服务实现分离开来,将服务调用方和
|
||||
|
||||
## 实战演示
|
||||
|
||||
SLF4J (Simple Logging Facade for Java)是 Java 的一个日志门面(接口),其具体实现有几种,比如:Logback、Log4j、Log4j2 等等,而且还可以切换,在切换日志具体实现的时候我们是不需要更改项目代码的,只需要在 Maven 依赖里面修改一些 pom 依赖就好了。
|
||||
Spring 框架提供的日志服务 SLF4J 其实只是一个日志门面(接口),但是 SLF4J 的具体实现可以有几种,比如:Logback、Log4j、Log4j2 等等,而且还可以切换,在切换日志具体实现的时候我们是不需要更改项目代码的,只需要在 Maven 依赖里面修改一些 pom 依赖就好了。
|
||||
|
||||

|
||||
|
||||
|
@ -766,8 +766,8 @@ LocalTime.class //时间 format: HH:mm:ss
|
||||
|
||||
```java
|
||||
public void oldFormat(){
|
||||
Date now = new Date();
|
||||
//format yyyy-MM-dd
|
||||
Date now = new Date();
|
||||
//format yyyy-MM-dd HH:mm:ss
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String date = sdf.format(now);
|
||||
System.out.println(String.format("date format : %s", date));
|
||||
|
Loading…
x
Reference in New Issue
Block a user