pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

Pino showing the wrong time (one hour too early) #945

Closed daniellwdb closed 3 years ago

daniellwdb commented 3 years ago

I am using WSL2, I have "pino": "^6.9.0" and "pino-pretty": "^4.3.0"installed and I am using the following config

import pino from "pino"

const prettyPrint: pino.LoggerOptions["prettyPrint"] = {
  colorize: true,
  ignore: "hostname,pid",
  translateTime: "yyyy-mm-dd HH:MM:ss",
}

export const logger = pino({
  name: process.env.npm_package_name,
  ...(process.env.NODE_ENV === "development" && { prettyPrint }),
})

I noticed that the time in my logs is not the right time, when I run date +"%T" I get 23:17:16 while pino outputs [2021-01-01 22:17:16] INFO (my-project-name): Hello

Also small question: would node dist/index.js | pino-redis -U redis://username:password@localhost:6379 be enough for your recommendation? In Pino parlance we call all log processors "transports", and recommend that the transports be run as separate processes, piping the stdout of the application to the stdin of the transport.

mcollina commented 3 years ago

In which timezone are you in?

daniellwdb commented 3 years ago

In which timezone are you in?

Europe/Amsterdam

mcollina commented 3 years ago

Pino logs in UTC. I think you are not printing the timezone.

daniellwdb commented 3 years ago

Thanks I will look into this

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.