Log4cxx
  1. Log4cxx
  2. LOGCXX-15

PatternLayout don't use locale time zone,it's use GMT tome zone

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.7
    • Fix Version/s: 0.10.0
    • Component/s: Layout
    • Labels:
      None
    • Environment:
      redhat linux advanced server 3.0

      Description

      PatternLayout don't use locale time zone,it's use GMT tome zone to layout.
      the following is my log4j.xml :

      <!-- A time/date based rolling appender -->
      <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
      <param name="File" value="/home/smsc/site/logs/pnote_db.log"/>
      <param name="Append" value="true"/>
      <param name="MaxFileSize" value="500KB"/>
      <param name="MaxBackupIndex" value="7"/>
      <param name="Threshold" value="DEBUG"/>

      <layout class="org.apache.log4j.PatternLayout">
      <!-- The default pattern: Date Priority [Category] Message\n -->
      <param name="ConversionPattern" value="%d

      {%Y-%m-%d %Z%H:%M:%S}

      %-5p [%c:%L] %m%n"/>

      </layout>
      </appender>

      for example: this time my system is showing time at Thu Sep 9 15:04:12 HKT 2004,but log4cxx print time is 2004-09-09 GMT06:04:12.

      How can I show locale time in log4cxx?
      I think it would be show locale time zone .

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        64d 19h 40m 1 Curt Arnold 13/Nov/04 02:55
        Curt Arnold made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.9.8 [ 10782 ]
        Resolution Fixed [ 1 ]
        Hide
        Curt Arnold added a comment -

        I did an ad-hoc test with the specified format string and the new time rework does appear to fix the problem.

        Show
        Curt Arnold added a comment - I did an ad-hoc test with the specified format string and the new time rework does appear to fix the problem.
        hbzhang created issue -

          People

          • Assignee:
            Michaël CATANZARITI
            Reporter:
            hbzhang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development