1
0
Fork 0

Allows logs to use local time zone instead of UTC

Co-authored-by: Ludovic Fernandez <ldez@users.noreply.github.com>
This commit is contained in:
Damien Duportal 2019-06-17 09:20:03 +02:00 committed by Traefiker Bot
parent 889b38f75a
commit 8b08f89d2c
2 changed files with 27 additions and 0 deletions

View file

@ -24,6 +24,8 @@ func (f *CommonLogFormatter) Format(entry *logrus.Entry) ([]byte, error) {
var timestamp = defaultValue
if v, ok := entry.Data[StartUTC]; ok {
timestamp = v.(time.Time).Format(commonLogTimeFormat)
} else if v, ok := entry.Data[StartLocal]; ok {
timestamp = v.(time.Time).Local().Format(commonLogTimeFormat)
}
var elapsedMillis int64