Skip to content

Commit c1c7593

Browse files
committed
chore(logging): add pino-pretty to prettify logs
1 parent 7d4d92e commit c1c7593

File tree

3 files changed

+99
-19
lines changed

3 files changed

+99
-19
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@fastify/autoload": "^4.0.0",
3939
"@fastify/sensible": "^4.0.0",
4040
"fastify": "^3.29.0",
41-
"fastify-plugin": "^3.0.1"
41+
"fastify-plugin": "^3.0.1",
42+
"pino-pretty": "^7.6.1"
4243
}
4344
}

pnpm-lock.yaml

+90-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import Fastify from 'fastify'
33
import autoLoad from '@fastify/autoload'
44

55
const fastify = Fastify({
6-
logger: true
6+
logger: {
7+
prettyPrint: {
8+
colorize: true,
9+
translateTime: 'HH:MM:ss.l',
10+
ignore: 'pid,hostname'
11+
}
12+
}
713
})
814

915
fastify.register(autoLoad, {

0 commit comments

Comments
 (0)