feat(monitoring): change logger to pino
This changes the logger used to be pino, which print the logs on a single line per log event
This commit is contained in:
parent
8a3481ea8b
commit
9b24bd0c41
8 changed files with 16 additions and 64 deletions
|
|
@ -1,12 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -x
|
||||
# do anything here
|
||||
|
||||
mkdir -p /volumes/static/auth/
|
||||
cp -r /extra/login_demo.html /volumes/static/auth/index.html
|
||||
cp -r /extra/login_demo.js /volumes/static/auth/login_demo.js
|
||||
|
||||
# run the CMD [ ... ] from the dockerfile
|
||||
exec "$@"
|
||||
|
|
|
|||
|
|
@ -4,23 +4,9 @@ import fastify, { FastifyInstance } from 'fastify';
|
|||
import app from './app';
|
||||
|
||||
const start = async () => {
|
||||
const envToLogger = {
|
||||
development: {
|
||||
transport: {
|
||||
target: 'pino-pretty',
|
||||
options: {
|
||||
translateTime: 'HH:MM:ss Z',
|
||||
ignore: 'pid,hostname',
|
||||
},
|
||||
},
|
||||
},
|
||||
production: true,
|
||||
test: false,
|
||||
};
|
||||
|
||||
const f: FastifyInstance = fastify({ logger: envToLogger.development });
|
||||
const f: FastifyInstance = fastify({ logger: { level: 'info' } });
|
||||
process.on('SIGTERM', () => {
|
||||
f.log.info('Requested to shutdown');
|
||||
f.log.warn('Requested to shutdown');
|
||||
process.exit(134);
|
||||
});
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue