I have this simple function that I created to log whatever happens in my code:
const pino = require('pino')
module.exports = pino({
transport: {
target: "pino-pretty",
options: {
translateTime: "SYS:dd-mm-yyyy HH:MM:ss",
ignore: "pid,hostname",
destination: './logs/logs.txt'
}
}
})
The problem with destination
. If this option is, pino
will write everything in file, not in console, if there is not, will print in console, but not in file. I want to print in console and write logs at the same time.
Is this possible?