Questions tagged [pino]
18 questions
6
votes
0 answers
Getting uncaughtException: Error: Cannot find module '...\.next\server\app\home\lib\worker.js' when trying to use pino.transport in Next.js
I have created a Next.js project with typescript using create-next-app. For logging of this particular project I have decided to use Pino logging library as it is recommended by Next.js itself.
When I am using Pino without its transport…

user22177053
- 61
- 1
6
votes
0 answers
NestJS: Pino Logger not working correctly with GraphQL requests
I am using NestJS v9 with the express adapter and the @nestjs/graphql library and am having issues extracting headers from the graphql request and appending them to the log messages using the pino logging library.
Below is my LoggerModule
import {…

mh377
- 1,656
- 5
- 22
- 41
3
votes
0 answers
How pino is faster than other library?
Pino is fastest json logger in the town but how it achieves better performance than others like winston, bunyan, morgan? As per https://www.nearform.com/blog/pino-the-fastest-node-js-logger-for-production/
Optimized JS code, e.g. for serialisation…

gourav kumar
- 141
- 1
- 11
2
votes
0 answers
How to use pino-pretty on frontend
I am testing pino for a frontend application (VueJs). I would like to use pino-pretty to format the log in console. However, when I import pino-pretty it gives errors:
SyntaxError: Identifier 'process' has already been declared

Devs love ZenUML
- 11,344
- 8
- 53
- 67
1
vote
2 answers
Error not sent to Sentry using pino-sentry-transport
I try to send errors to sentry in the production environment:
import pino from 'pino';
const logger = pino(
{
level: 'error',
formatters: {
level: label => {
return { level: label };
},
},
…

Slim
- 5,527
- 13
- 45
- 81
0
votes
0 answers
How to send logs to logstash from nestjs application using nestjs-pino?
I have the following configuration code in my AppModule in nestjs:
LoggerModule.forRoot({
pinoHttp: {
base: undefined,
autoLogging: false,
genReqId: () => uuidv4(),
messageKey: 'message',
level: 'info',
…

Sardor Taylakov
- 1
- 1
0
votes
1 answer
How can I rotate log files with nestjs-pino?
I'm developing server with nestjs and I wanna rotate log files with nestjs-pino like winston-daily-rotate-file.
I chose nest-pino for logger beacause of its simplicity and being much more comfortable than winston.
However, I don't know how to rotate…
0
votes
1 answer
Pino swap mergingObject and message params
I'm using fastify and pino-pretty
pino.info('Error doing that', Error) <- prints {} for Error
pino.info(Error, 'Error doing that') <- prints the error in full
All my other logging, uses the more natural message,data format
Is there a way to switch…

Titan
- 5,567
- 9
- 55
- 90
0
votes
0 answers
Pino doesn`t save log with log level `debug` into mongo
I override methods ('info', 'debug', 'error') of console to save logs in db, but when I try to save
log with level 'debug', it isn`t saved.
Pino config:
import { pino } from 'pino';
export const getPinoLogger = (connectionMongoString) => {
const…
0
votes
0 answers
Customize pino/pino-pretty in fastify-cli
I have a fastify v4 app being developed with fadtify-cli. How do I customize pino logger settings in the cli environment? I have lots of working examples with the logger being on the server (where code is 'listening').

Energetic Pixels
- 349
- 3
- 15
0
votes
0 answers
Creating a custom pino logger per request in koa middleware is resulting in open files accumulating
I'm attempting to set up a custom logger per request on my Koa HTTP server using Koa middleware. The custom pino logger should send logs to both the console and a file. However, I'm encountering an issue with my current implementation regarding…

BML91
- 2,952
- 3
- 32
- 54
0
votes
1 answer
Pino logger not logging anything when setup with multiple transports
When I setup a simple pino logger with custom log levels like so:
import pino from "pino";
const simpleLogger = pino({
mixin() {
return { appName: "TEST SIMPLE LOGGER" };
},
level: "silly",
useOnlyCustomLevels: true,
customLevels: {
…

BML91
- 2,952
- 3
- 32
- 54
0
votes
0 answers
How to pipe pino-pretty with tsx?
I installed pino-pretty and tsx in my project and created a command:
"start": "tsx watch -r dotenv/config ./src/index.ts | pino-pretty",
Unfortunately I don't get any formatting with this command. Any idea how to make this work instead? I am using…
user22143675
0
votes
1 answer
pino-pretty does not output numbers, but only strings
I have a very simple log file with as below app.log
{"level":30,"time":"2023-06-19T04:01:56.478Z","pid":2484,"hostname":"YMLTITD2227","msg":77}
{"level":30,"time":"2023-06-19T04:01:56.478Z","pid":2484,"hostname":"YMLTITD2227","msg":"42"}
Notice…

Mrigank Vallabh
- 54
- 1
- 8
0
votes
0 answers
How to redact a stringified object using Pino LoggerOptions
I know the pino could redact the property value from an object, but how if the object is already been stringified? Is there anyway to redact the information from that stringified object?

小熊呆呆Kumaa
- 13
- 2