The follow diagram explains how our catalyst server manages logs
Pino-pretty logs for development mode:
install pino-pretty as a development dependency.
npm install --save-dev pino-pretty
manifest.json
"hapi-pino": {
"plugin": "require:hapi-pino",
"options": {
"$filter": "env.NODE_ENV",
"$default": {},
"development": {
"transport": {
"target": "pino-pretty",
"options": {
"colorize": true,
"translateTime": true
}
}
}
}
}
Pino-pretty logs for production mode(legacy transport):
Install Pino-pretty
npm install pino-pretty
It is recommended to use pino-pretty with pino by piping output to the CLI tool:
node --max-http-header-size=32768 ./examples/simple/index.js | ./node_modules/.bin/pino-pretty --config=./examples/simple/.pino-prettyrc
.pino-prettyrc
{
"colorize": true,
"singleLine": true
// ... pass pino-pretty options here
}
.pino-pretty pass the CLI Arguments
node js profile review
clinic doctor --autocannon [ /items ] -- node --max-http-header-size=32768 ./examples/simple/index.js | ./node_modules/.bin/pino-pretty --config=./examples/simple/.pino-prettyrc