mpen
mpen

Reputation: 283083

Fastify prettyPrint log in local time?

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?

Upvotes: 0

Views: 2294

Answers (1)

Manuel Spigolon
Manuel Spigolon

Reputation: 12900

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

Upvotes: 1

Related Questions