参考:https://blog.csdn.net/u014453475/article/details/100579856
官方文档:
The second parameter specifies a timezone. For example, the '%date{HH:mm:ss.SSS, Australia/Perth} would print the time in the time zone of Perth, Australia, the world's most isolated city. Note that in the absence of the timezone parameter, the default timezone of the host Java platform is used. If the specified timezone identifier is unknown or misspelled, the GMT timezone is assumed as dictated by the TimeZone.getTimeZone(String) method specification.
意思是可以在yyyy-MM-dd HH:mm:ss.SSS后面加一个指定的时区,用逗号分隔开。如yyyy-MM-dd HH:mm:ss.SSS,CTT
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS})
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS,CTT})
CTT为上海时间
参考资料:https://blog.csdn.net/baidu_38404101/article/details/102495885
========日志时间有问题,也可能是代码获取的到的时间就是有问题的==========
System.currentTimeMills获取到的时间不是系统的当前时区的时间
这时启动jar包的命令中添加时区参数java -jar -Duser.timezone=GMT+08 xxx.jar