Discussion:
[jira] [Created] (LOG4J2-698) How do I adjust for daylight savings?
Bryan Hsueh (JIRA)
2014-07-02 21:53:25 UTC
Permalink
Bryan Hsueh created LOG4J2-698:
----------------------------------

Summary: How do I adjust for daylight savings?
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh


I am using <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> and consuming time in GMT. When I cross daylight savings, my log hour changes. How do I make this consistent? Specifically, I'm UTC-5 right now, and come winter, I want to log as UTC-6. Thanks.



--
This message was sent by Atlassian JIRA
(v6.2#6252)
Bryan Hsueh (JIRA)
2014-07-02 22:52:24 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Hsueh updated LOG4J2-698:
-------------------------------

Description: How come <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter. (was: I am using <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> and consuming time in GMT. When I cross daylight savings, my log hour changes. How do I make this consistent? Specifically, I'm UTC-5 right now, and come winter, I want to log as UTC-6. Thanks.)
Post by Bryan Hsueh (JIRA)
How do I adjust for daylight savings?
-------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Bryan Hsueh (JIRA)
2014-07-02 22:52:24 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Hsueh updated LOG4J2-698:
-------------------------------

Summary: How does log4j2 handle daylight savings? (was: How do I adjust for daylight savings?)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Scott Harrington (JIRA)
2014-07-25 03:17:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14074005#comment-14074005 ]

Scott Harrington commented on LOG4J2-698:
-----------------------------------------

"Isn't CST GMT-5 right now?"

No, it's not. CDT is GMT-5. CST is GMT-6.

You should try {America/Chicago} or {US/Central} in your pattern - these will work as you expect: GMT-5 in summer and GMT-6 in winter.

In Java, while CST and CDT are not proper IDs that you should pass to TimeZone.getTimeZone, you can ask a TimeZone for its getDisplayName(timestamp) and it will return "CST" if the specified timestamp is in winter and "CDT" if the timestamp is in summer.

See http://ztrek.blogspot.com/2009/08/est-and-edt-pst-and-pdt-just-say-no.html

Also see http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-26 15:13:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-698:
-------------------------------

Description: How come <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter. (was: How come <PatternLayout pattern="%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter. )
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-26 15:13:39 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14075414#comment-14075414 ]

Remko Popma commented on LOG4J2-698:
------------------------------------

Bryan, does Scott's comment solve the problem?
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-26 15:13:39 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14075414#comment-14075414 ]

Remko Popma edited comment on LOG4J2-698 at 7/26/14 3:13 PM:
-------------------------------------------------------------

Bryan, does Scott's comment solve the problem? (Can we close this ticket or is there still work remaining?)


was (Author: ***@yahoo.com):
Bryan, does Scott's comment solve the problem?
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-28 06:34:39 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-698:
-------------------------------

Description:
How come {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %\-5level- %msg%n"/>}} does not produce the same log timestamp as {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %\-5level- %msg%n"/>}}?

Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.

was:How come <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %-5level- %msg%n"/> does not produce the same log timestamp as <PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %-5level- %msg%n"/>? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %\-5level- %msg%n"/>}} does not produce the same log timestamp as {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %\-5level- %msg%n"/>}}?
Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-09-19 17:03:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma resolved LOG4J2-698.
--------------------------------
Resolution: Not a Problem

Closing since the question was answered. Feel free to reopen if required.
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %\-5level- %msg%n"/>}} does not produce the same log timestamp as {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %\-5level- %msg%n"/>}}?
Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-09-19 17:03:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma closed LOG4J2-698.
------------------------------
Post by Bryan Hsueh (JIRA)
How does log4j2 handle daylight savings?
----------------------------------------
Key: LOG4J2-698
URL: https://issues.apache.org/jira/browse/LOG4J2-698
Project: Log4j 2
Issue Type: Question
Components: Layouts
Affects Versions: 2.0-rc2
Environment: Ubuntu 12.04
Reporter: Bryan Hsueh
How come {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{CST\} %\-5level- %msg%n"/>}} does not produce the same log timestamp as {{<PatternLayout pattern="%d\{HH:mm:ss.SSS\}\{GMT-5\} %\-5level- %msg%n"/>}}?
Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Loading...