tanmaybaid opened a new issue, #3930:
URL: https://github.com/apache/logging-log4j2/issues/3930

   ## Description
   
   DatePatternConverter incorrectly converting date pattern with comma "," 
followed by a whitespace starting Log4J 2.25.0.
   
   For a PatternLayout where date pattern contains comma followed by a 
whitespace, the DatePatternConverter is adding a `'` after the `,` in the 
converted date string.
   
   For e.g. the pattern layout `%date{EEE, dd MMM yyyy HH:mm:ss zzz}{GMT}` 
gives incorrect results.
   
   Actual: `Thu,' 18 Sep 2025 00:42:14 GMT`
   Expected: `Thu, 18 Sep 2025 00:42:14 GMT`
   
   Notice the `'` after `,` in the actual response
   
   The issue is related to the "Date & Time Formatting" changes introduced in 
Log4J 2.25.0 as described here:
   
https://logging.apache.org/log4j/2.x/release-notes.html#release-notes-2-25-0-instant-format
   
   This issue is resolved by setting the 
[log4j2.instantFormatter](https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.instantFormatter)
 property to legacy
   
   ## Configuration
   Pattern layout with date pattern that includes `, ` (comma followed by 
whitespace), for e.g. `%date{EEE, dd MMM yyyy HH:mm:ss zzz}{GMT}`
   
   **Version:** 2.25.0
   
   **Operating system:** MacOS and Linux
   
   **JDK:** amazon-corretto-21.jdk and amazon-corretto-17.jdk
   
   ## Logs
   -
   
   ```
   [Stacktraces, errors, etc. relevant applications logs.]
   ```
   
   ## Reproduction
   Publish log using pattern layout `%date{EEE, dd MMM yyyy HH:mm:ss zzz}{GMT}`


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to