You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2023/01/02 12:31:40 UTC

[GitHub] [logging-log4j2] dnsmkl commented on pull request #1173: LOG4J2-1631 Honor timezone in file name pattern

dnsmkl commented on PR #1173:
URL: https://github.com/apache/logging-log4j2/pull/1173#issuecomment-1368909016

   I would like to highlight that `Calendar.getInstance().getTimeZone()` is different from `TimeZone.getDefault()`.
   So pattern "logs/app-%d{yyyy-MM-dd}.log.gz" has slight change.
   
   Before this PR, timezone used was `Calendar.getInstance().getTimeZone()`
   After this PR, for same pattern timezone will be `TimeZone.getDefault()`.
   
   Is such change acceptable?
   
   From Calendar.java:
   
       private static TimeZone defaultTimeZone(Locale l) {
           TimeZone defaultTZ = TimeZone.getDefault();
           String shortTZID = l.getUnicodeLocaleType("tz");
           return shortTZID != null ?
               TimeZoneNameUtility.convertLDMLShortID(shortTZID)
                   .map(TimeZone::getTimeZone)
                   .orElse(defaultTZ) :
               defaultTZ;
       }
   


-- 
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-unsubscribe@logging.apache.org

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