pinojs / pino-pretty

🌲Basic prettifier for Pino log lines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

option to turn off prettyprint in api

rubiin opened this issue · comments

Using pretty print along with file in transport. However i cannot seem to turn of pretty printing. Is there anything I am missing

can you make an example?

I am on nestjs using nestjs-pino

Heres how I am logging on std as well as file using transports:

	
{
                            pinoHttp: {
						level: "info",
						redact: {
							paths: ["req.headers.authorization"],
							remove: true,
						},
						transport: {
							targets: [
								{
									target: "pino/file",
									level: "info",
									options: {
										destination: "logs/info.log",
										mkdir: true,
									},
								},
								{
									target: "pino-pretty",
									level: "info",
									options: {
										colorize: true,
										prettyPrint: false,
										translateTime: true,
										ignore: "pid,hostname",
									},
								},
							],
						},
					},
				};

I think pino-pretty does not have a option to turn off prettyPrint at the moment

It doesn't and it won't. If you do not want to pretty print logs, do not send them to the pretty print module.

Thanks for reporting. We do not have the resources to support Nest.js users. Please refer to the Nest Discord channel (support) for such questions.