Skip to content

Commit 52c86fa

Browse files
author
Azhor Ahai
committed
added mongoDb support to logger
1 parent d08e52b commit 52c86fa

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require this module as a variable, and initialize the logger as logger.getLoggerObj
2+

logger.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const winston = require("winston")
22
, extend = require('extend')
3+
, dbURL = "http://localhost:27017/LoggerDb"
34

45
var defaults = {
56
transports: {
@@ -20,6 +21,11 @@ var defaults = {
2021
json: false,
2122
handleExceptions: true,
2223
humanReadableUnhandledException: true
24+
},
25+
MongoDB: {
26+
db : dbURL,
27+
collection: 'logs'
28+
2329
}
2430
}
2531
}

0 commit comments

Comments
 (0)