[logback-user] logback output date using GMT instead of local time

Ted Meng ted_meng at comcast.net
Tue Mar 23 05:55:13 CET 2010


Hi, I do not remember seeing it in the past but today I used the 
following simple program
to print out log message with slf4j/logback. and to my surprise, it is 
outputing with GMT time
instead of my  local time.  In other words, slf4j/logback would always 
print out datetime
using GMT for PatternLayout like the following

<layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>%d{MM/dd/yyyy-HH:mm:ss,SSS} %5level %class{1}:%line 
- %msg%n</Pattern>
 </layout>

am I doing something wrong or is there a config option to specify output 
local time instead of
the default GMT time.? 

Thanks very much.
Below is the simple program to print out the time that indictates it is 
using GMT instead of localtime.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class L
{
    public static final Logger log = LoggerFactory.getLogger(L.class);
    public static void main(String[] args)
    {        
        log.info("test");
    }
}


More information about the Logback-user mailing list