Merge branch 'userHealth' into 'main'

user service health

See merge request v3/service/logger!14
This commit is contained in:
Sylvain Briat 2023-04-03 12:35:40 +00:00
commit 404ac0d61a
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'), exchange: configService.get<string>('RMQ_EXCHANGE'),
routingKey: 'logging.user.update.crit', routingKey: 'logging.user.update.crit',
}, },
loggingUserHealthCrit: {
exchange: configService.get<string>('RMQ_EXCHANGE'),
routingKey: 'logging.user.health.crit',
},
}, },
uri: configService.get<string>('RMQ_URI'), uri: configService.get<string>('RMQ_URI'),
connectionInitOptions: { wait: false }, connectionInitOptions: { wait: false },

View File

@ -84,4 +84,14 @@ export class UserController {
); );
this.logger.crit(JSON.parse(message)); 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));
}
} }