Pino: Is there any way to print any output to a logfile?

Created on 6 Jan 2017  路  3Comments  路  Source: pinojs/pino

Hey,

idk if I am to dumb to find it but is there anyway to print pinos output globally to a log file?

  • dunklesToast
question

All 3 comments

Ok, when I add node foo > log.txt then it will print anything to my file but I have no console output anymore :(

This question is really covered in the discussion on how we deal with transports -- https://github.com/pinojs/pino/blob/master/docs/transports.md

Basically, Pino is a logger and only a logger. It does not handle the output in anyway. So you need to use pipes to handle the output in whatever way you wish.

With node foo > log.txt you can simply tail -f log.txt to view the output. Or you can use pino-tee to write to a file while retaining the output on stdout -- https://github.com/pinojs/pino/blob/master/docs/howtos.md#multiple

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcollina picture mcollina  路  3Comments

P4sca1 picture P4sca1  路  4Comments

normancarcamo picture normancarcamo  路  6Comments

davidmarkclements picture davidmarkclements  路  6Comments

ronag picture ronag  路  5Comments