user service health

This commit is contained in:
sbriat 2023-04-03 14:34:14 +02:00
parent 7444e46738
commit 82f747fbab
2 changed files with 14 additions and 0 deletions

View File

@ -150,6 +150,10 @@ import { AdminApiController } from './logger/adapters/primaries/admin-api.contro
exchange: configService.get<string>('RMQ_EXCHANGE'),
routingKey: 'logging.user.update.crit',
},
loggingUserHealthCrit: {
exchange: configService.get<string>('RMQ_EXCHANGE'),
routingKey: 'logging.user.health.crit',
},
},
uri: configService.get<string>('RMQ_URI'),
connectionInitOptions: { wait: false },

View File

@ -84,4 +84,14 @@ export class UserController {
);
this.logger.crit(JSON.parse(message));
}
@RabbitSubscribe({
name: 'loggingUserHealthCrit',
})
public async userHealthCriticalHandler(message: string) {
this.logger.configure(
loggerOptions('user', level.crit, 'critical', 'health'),
);
this.logger.crit(JSON.parse(message));
}
}