Calendar year versus Week-based year
YYYY
means week-based year. For calendar year, use yyyy
.
Read the documentation carefully when doing such work.
ISO 8601
I suggest doing all your logging using standard ISO 8601 formats. For a date-only value, that would be yyyy-MM-dd
pattern.
UTC
For any given moment, the date varies around the globe by time zone. For example, the new year 2020 arrived hours earlier in Tokyo Japan than in Kolkata India, and several hours even later in Toledo Ohio US.
So you should specify the time zone by which you want to perceive the date. If omitted, your JVM’s current default time zone is implicitly applied. Better to explicitly specified the desired/expected time zone. I don’t recall how to do this in Tomcat, and don’t have the docs available now, so you’ll have to look that up.
Generally best to use UTC (an offset of zero hours-minutes-seconds) for logging.