Spring boot app with default logger settings and using lombok's @Slf4j
Prints logs like
{"timestamp":"2020-02-26T11:25:57.485-05:00" ..........}
Time shown 11:25 is in EST or NewYork timezone
How do we change this to log timestamp in UTC timezone?
I have tried setting
logging:
pattern:
dateformat: yyyy-MM-dd HH:mm:ss.SSS, UTC
Also setting JVM level timzone by using
@PostConstruct
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
and have also tried configuring in application.yaml
logging:
pattern:
console: '%d{"yyyy/MM/dd HH:mm:ss,SSS,UTC"} [%p] [%t] %M\(%F:%L\) - %msg%n'