deno
deno copied to clipboard
`pino` logger doesn't work in Deno
The below pino script:
import { pino } from "pino";
const transport = pino.transport({
level: "trace",
target: "pino/file",
options: { destination: "log.txt" },
});
export const logger = pino(transport);
logger.info("abc");
should creates log.txt file with something like the below contents:
{"level":30,"time":1730727130896,"pid":12345,"hostname":"your-hostname","msg":"abc"}
But it doesn't seem working.
(This was pointed in https://github.com/denoland/std/issues/6124#issuecomment-2454687301 )
Note: pino is the logger for fastify. It has relatively large number of github stars (14K) and weekly npm downloads (8M/week)
maybe duplicate of https://github.com/denoland/deno/issues/26154?
Ah, yes. Thanks!