From 98e4e4a2006c27d9ced1ecc8f111df095210037f Mon Sep 17 00:00:00 2001 From: Ceki Gulcu Date: Tue, 11 Jun 2013 15:50:31 +0200 Subject: [PATCH] clearer description of the timezone parameter for %d --- .../src/site/pages/manual/layouts.html | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) mode change 100644 => 100755 logback-site/src/site/pages/manual/layouts.html diff --git a/logback-site/src/site/pages/manual/layouts.html b/logback-site/src/site/pages/manual/layouts.html old mode 100644 new mode 100755 index e43ad4cf72..d3153de10a --- a/logback-site/src/site/pages/manual/layouts.html +++ b/logback-site/src/site/pages/manual/layouts.html @@ -534,6 +534,8 @@

PatternLayout

d{pattern}
date{pattern}
+ d{pattern, timezone}
+ date{patterntimezone}

Used to output the date of the logging event. The date @@ -574,25 +576,26 @@

PatternLayout

14:06:49.812 - %date{dd MMM yyyy ;HH:mm:ss.SSS} + %date{dd MMM yyyy;HH:mm:ss.SSS} 20 oct. 2006;14:06:49.812 -

In addition to the date pattern, this converter admits a - second option as the timezone. Thus, the - '%date{HH:mm:ss.SSS,Australia/Perth} would print the time in - the time zone of Perth, Australia, the world's most isolated - city. +

The second parameter can be used to specify a + timezone. Note that in the absence of the timezone + parameter, the default timezone of the host Java platform is + used. Thus, the '%date{HH:mm:ss.SSS, Australia/Perth} + would print the time in the time zone of Perth, Australia, + the world's most isolated city.

-

Given that the comma ',' character is interpreted as the - option separator, the pattern string [HH:mm:ss,SSS] will - print the time in the [SSS] time zone which does not - exist. Thus, the time will be printed in the default GMT - timezone. If you wish to include a comma in your date - pattern, then simply enclose the pattern between quotes. For - example, %date{"HH:mm:ss,SSS"}. +

common error Given that the + comma ',' character is interpreted as the parameter + separator, the pattern HH:mm:ss,SSS will be + interpreted as the pattern HM:mm:ss and the + timezone SSS. If you wish to include a comma in + your date pattern, then simply enclose the pattern between + quotes. For example, %date{"HH:mm:ss,SSS"}.