ppkarwasz commented on code in PR #3789:
URL: https://github.com/apache/logging-log4j2/pull/3789#discussion_r2196942219


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java:
##########
@@ -109,40 +109,19 @@ private static String readPattern(@Nullable final 
String[] options) {
      * @since 2.25.0
      */
     static String decodeNamedPattern(final String pattern) {
-        // If legacy formatters are enabled, we need to produce output aimed 
for `FixedDateFormat` and `FastDateFormat`.

Review Comment:
   I've moved the original comment to `NamedInstantPattern#getLegacyPattern()` 
and reformatted it as Javadoc in 
https://github.com/apache/logging-log4j2/pull/3789/commits/e3c6f6d1907b4717dfdfdebeffec2f408315a614.
   
   I also adjusted the tone slightly. In my view, the use of the `n` pattern 
letter in legacy formats isn't a violation of the `SimpleDateFormat` contract, 
but rather a Log4j-specific extension—similar to how `FastDateFormat` extends 
support for `Z`. While I agree that `DateTimeFormatter` was already available 
when microsecond and nanosecond support was added in Log4j 2.11.0, and that 
choosing `n` may not have been ideal in hindsight, it was a deliberate design 
decision.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to