Skip to content

winston time transport always logs in UTC #17

@benvandenberg

Description

@benvandenberg

Hello,

I have installed deepstreem.io, version 3.1.0, as an RPM on a CentOS 7.2 machine.

My logger configuration looks like this:

logger:
   name: winston
   options:
     # specify a list of transports (console, file, time)
     -
       type: time
       options:
         filename: /var/log/deepstream/deepstream-
         datePattern: yyyy-MM-dd.log
         maxsize: 104857600
         maxFiles: 5
         localTime: true
         zippedArchive: true

The timestamp in the logs is always UTC. I exported a global TZ environment variable set to "America/Edmonton", and also set the machine's timezone to MDT, but the logger continues to output in UTC. I changed the RTC time to MDT and back to UTC, also with no success. Each change was followed by a reboot of the machine, to be certain it took effect.

The output of the timedatectl command is:

$ sudo timedatectl
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.

      Local time: Tue 2017-10-17 14:32:41 MDT
  Universal time: Tue 2017-10-17 20:32:41 UTC
        RTC time: Tue 2017-10-17 20:32:41
       Time zone: America/Edmonton (MDT, -0600)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2017-03-12 01:59:59 MST
                  Sun 2017-03-12 03:00:00 MDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2017-11-05 01:59:59 MDT
                  Sun 2017-11-05 01:00:00 MST

I'm not sure if this is something related to the deepstream.io-logger-winston, or if it may be tracked by this issue: winstonjs/winston-daily-rotate-file#88

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions