From 15fa0285cf2661c6cf413ca53b16faa6b609fdc0 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Mon, 4 Dec 2023 12:12:54 +0000 Subject: [PATCH] created the logger --- src/utils/logger.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils/logger.js diff --git a/src/utils/logger.js b/src/utils/logger.js new file mode 100644 index 00000000..371d7df3 --- /dev/null +++ b/src/utils/logger.js @@ -0,0 +1,15 @@ +import { createLogger, format, transports } from 'winston' + +const logger = createLogger({ + format: format.combine( + format.timestamp(), + format.json() + ), + defaultMeta: { service: 'lpa-data-validation-frontend' }, + transports: [ + new transports.Console(), + new transports.File({ filename: 'combined.log' }) + ] +}) + +export default logger