-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MinimumLevel doesn't seem to do anything #458
Comments
Possible duplicate #455. |
I was facing the same issue so I started debugging the implementation. It looks like Pino is filtering messages before they go to transports (which makes sense, but it should be clearly stated in the piano-pretty docs as well). So be sure to also set |
Thanks for reporting! Would you like to send a Pull Request to address this issue? |
@mcollina but there is no error, everything works as expected. Are you talking about a PR to docs to explain it better? |
yes, exactly! |
I have a case where const prettyStream = build({
minimumLevel: "trace",
colorize: true,
messageFormat: (log) => {
let print = "";
if (Number.isInteger(log?.index)) print += `(${log?.index}) `;
if (log?.address) print += `${log?.address}: `;
print += `${log?.msg}`;
return print;
},
ignore: "hostname,address,index",
});
const fileStream = {
level: "trace",
stream: fs.createWriteStream(getLogFileName(), { flags: "a" }),
};
const multistream = pino.multistream([fileStream, prettyStream]);
export const logger = pino({ level: "trace" }, multistream); So level is set in all cases, but still not working for |
This should work const prettyStream = build({
minimumLevel: "trace",
colorize: true,
messageFormat: (log) => {
let print = "";
if (Number.isInteger(log?.index)) print += `(${log?.index}) `;
if (log?.address) print += `${log?.address}: `;
print += `${log?.msg}`;
return print;
},
ignore: "hostname,address,index",
});
const fileStream = {
level: "trace",
stream: fs.createWriteStream(getLogFileName(), { flags: "a" }),
};
const multistream = pino.multistream([fileStream, { level: 'trace', stream: prettyStream }]);
export const logger = pino({ level: "trace" }, multistream); |
I have this command
ts-node src/server.ts | yarn pino-pretty -L info -i req.headers,res.headers,dd
But my logs still show this:
I've tried using
-L 30
etc, and nothing has workedThe text was updated successfully, but these errors were encountered: