0

I've figured out how to pretty-print the logs in fastify:

const server = fastify({
    logger: {
        prettyPrint: __DEV__ && {
            translateTime: 'h:MM:ss TT',
            colorize: true,
            ignore: 'pid,hostname'
        },
    },
})

But the time is in UTC. How can I get it in my local time or specify a timezone?

mpen
  • 272,448
  • 266
  • 850
  • 1,236

1 Answers1

1

Using pino-pretty@4 you need to set:

translateTime: 'SYS:h:MM:ss TT Z o',

All the cli args can be set with the option json

Manuel Spigolon
  • 11,003
  • 5
  • 50
  • 73