Wednesday, 15 September 2010

java - Configure DST(Daylight Savings Time) in log4j -



java - Configure DST(Daylight Savings Time) in log4j -

i need configure dst time application running in server in fiji. os level time has configured :

tue nov 11 17:28:51 **fjst** 2014

(fjst - republic of the fiji islands summer time)

i have changed log4j.xml configuration follow , tried:

class="lang-xml prettyprint-override"><layout class="org.apache.log4j.enhancedpatternlayout"> <param name="conversionpattern" value="%d{iso8601}{gmt+13} %-5p %c{1} [%x] [%t] - %m%n" />

this works bit fine, can workaround only, can't solution. next 2 issues there:

need restart application 2 times. during every dst changes service interruption there. it's not possible production.

we can't say, every day time alter +/- 1 hour. days can 50 mins. in case, log won't updated proper time.

is there patch available next java version prepare ? - "1.7.0_09-icedtea"

else there way alter log4j time os time? if great solution since there won't much service interruption.

according the docs enhancedpatternlayout, value in sec set of braces next %d string passed internally timezone.gettimezone(string), states string should be:

the id timezone, either abbreviation such "pst", total name such "america/los_angeles", or custom id such "gmt-8:00".

therefore, should able pass pacific/fiji, automatically utilize right time zone offset @ different times of year.

<param name="conversionpattern" value="%d{iso8601}{pacific/fiji} %-5p %c{1} [%x] [%t] - %m%n" />

also, historically republic of the fiji islands has been known not providing adequate notice when setting dst dates. countries seek found stable recurrence pattern, republic of the fiji islands has chosen announce dst changes each individual year. latest alter 2014 announced on oct 20th, , went effect on nov 2nd - leaving 12 days implement , distribute changes time zone databases. iana tzdb group acted quickly, releasing version 2014i on oct 22, , oracle issued corresponding tzupdater 1.4.9 on oct 31 incorporate change.

make sure download tzupdater 1.4.9 or greater , apply environment. long republic of the fiji islands unstable, need in future well. means fist bullet point not wanting restart production impossibility. 1 cannot predict government.

regarding sec bullet point: there no time zones anywhere in world shift 50 minutes. utilize dst shift 1 whole hour, except australia/lord_howe shifts 30 minutes.

java log4j dst

No comments:

Post a Comment