Skip to content

Commit 4b16284

Browse files
committed
chore(lrm): use environment variable to set logging level
1 parent 8ee146f commit 4b16284

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

web/lrm/server/.env.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ HUB_URL=amqps://messaging.integration.hub.esante.gouv.fr
22
LRM_PASSPHRASE=CHANGE_ME_mock_cert_password
33
GITHUB_TOKEN=mock_github_token
44
ADMIN_PASSWORD=mock_admin_password
5-
VHOST_CLIENT_MAP={"15-15_v2.1": ["fr.health.test.samuA", "fr.health.test.samuB"]}
5+
VHOST_CLIENT_MAP={"15-15_v2.1": ["fr.health.test.samuA", "fr.health.test.samuB"]}
6+
LOG_LEVEL=info

web/lrm/server/src/logger.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { transports, createLogger, format } from 'winston';
22

3-
const buildDefaultConsoleTransport = () => new transports.Console({ level: 'info' });
3+
const logLevel = process.env.LOG_LEVEL || 'info';
4+
5+
const buildDefaultConsoleTransport = () => new transports.Console({ level: logLevel });
46

57
export const logger = createLogger({
68
format: format.combine(

0 commit comments

Comments
 (0)