-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I recently spent some time figuring out how to use the pino-pretty plugin effectively. Since it wasn’t as straightforward as I initially hoped, I wanted to share my configuration and insights to help others avoid similar challenges.
Below is the setup I used, along with the key patterns and format details:

Field | Value |
---|---|
Name | PinoPretty |
Message Pattern | ^\[(\d{2}:\d{2}:\d{2}\.\d{3})\]\s+(\w+)\s+\(([^)]+)\):\s+(.*)$ |
Message start pattern | :\s+.* |
Time Format | HH:MM:SS.FF3 |
Time capture group | 1 |
Severity capture group | 2 |
Category capture group | 3 |
Pino Config
Pino Pretty Config
import pino from "pino";
const transport = pino.transport({
targets: [
{
level: "warn",
target: "pino-pretty", // must be installed separately
},
{
level: "trace",
target: "pino-pretty",
options: {
destination: ".logs/combined.log",
colorize: false,
append: false,
},
},
],
});
export const rootLogger = pino(transport);
export const createLogger = (name: string) => {
return rootLogger.child({ name });
};
Preview

smirok
Metadata
Metadata
Assignees
Labels
No labels