apache / apache/logging-log4j2

Default JTL timestamp format changed in 2.15.0

Open
#1,420 0 comments 0 reactions 0 assignees View on GitHub
bug layouts
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

## Description

Due to the solution of [LOG4J2-3075](https://issues.apache.org/jira/browse/LOG4J2-3075) all the timestamp patterns are now interpreted as `DateTimeFormatter` patterns. This caused a change in the interpretation of the default timestamp resolver format "yyyy-MM-dd'T'HH:mm:ss.SSSZZZ" (as noticed in [this StackOverflow question](https://stackoverflow.com/q/75956483/11748454)):

* before: the timezone pattern `ZZZ` was printed as `-06:00`, `+00:00` and `+06:00`,
* after: the timezone pattern `ZZZ` is printed without the colons: `-0600`, `+0000` and `+0600`.

## Possible solutions

* we can replace the `ZZZ` format specifier with `xxx`, which will give exactly the same output as before 2.15.0. The problem with this solution is that there is no `FastDateFormat` for it,
* we can replace the `ZZZ` format specifier with `XXX`. There is a `FastDateFormat` for it, but it outputs `Z` for the zero time zone.

Neither of the two solutions corresponds to one of the [standard ElasticSearch date formats](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.