Skip to content

Commit

Permalink
added custom logservice using winston for error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sahitya-chandra committed Dec 31, 2024
1 parent 63204a2 commit 5b1388e
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 5 deletions.
220 changes: 216 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"tailwind-merge": "^2.2.1",
"tailwindcss": "^3.4.3",
"typescript": "^5.3.3",
"winston": "^3.17.0",
"yaml": "^2.3.4"
},
"devDependencies": {
Expand Down
19 changes: 19 additions & 0 deletions scripts/tools/logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { createLogger, format, transports } = require('winston');

const logger = createLogger({
level: 'error', // minimum level of messages logger will handle
format: format.combine(
format.timestamp(),
format.json()
),
transports: [
new transports.Console({
format: format.combine(
format.colorize(),
format.simple()
)
})
],
});

module.exports = logger;
Loading

0 comments on commit 5b1388e

Please sign in to comment.