| | |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.TimeZone; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * @author lgh |
| | |
| | | public class WebApplication extends SpringBootServletInitializer { |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | // 开启 OkHttp 连接池的详细日志 |
| | | Logger.getLogger(okhttp3.OkHttpClient.class.getName()).setLevel(Level.FINE); |
| | | SpringApplication.run(WebApplication.class, args); |
| | | } |
| | | |
| | | @PostConstruct |
| | | void init() { |
| | | // 强制设置默认时区(影响整个JVM) |
| | | TimeZone.setDefault(TimeZone.getTimeZone("Europe/Paris")); |
| | | System.setProperty("user.timezone", "Europe/Paris"); |
| | | TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); |
| | | System.setProperty("user.timezone", "Asia/Shanghai"); |
| | | } |
| | | |
| | | @Override |