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
}
}
}
}
}
pass the NODE_ENV
as following:
NODE_ENV=development node ./examples/simple/index.js
Pino/file transport logs to stdout or file for production.
"transport": {
"targets": [
{
"target": "pino/file",
"options": {
"destination": 1
}
}
]
}
clinic doctor --autocannon [ /items ] -- node --max-http-header-size=32768 ./examples/simple/index.js | ./node_modules/.bin/pino-pretty --config=./examples/simple/.pino-prettyrc