mirror of
https://gitlab.com/mobicoop/v3/service/logger.git
synced 2026-01-10 14:52:39 +00:00
user service health
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user