@jmbl1685/logger
v1.0.20
Published
[![Module Logo](https://image.ibb.co/f4cWVL/nodejs-6-569582.png)](https://www.npmjs.com/package/@jmbl1685/logger)
Downloads
6
Readme
Logger System for Nodejs using MongoDB
Installation
$ npm install @jmbl1685/logger
Quick Start
How to use the module? Easy!!
'use strict'
const logger = require('@jmbl1685/logger').default({
host: '{{your_mongo_connection_string}}',
logname: 'logs' /* Optional */
})
// You can save anything in the log...
logger({
ip: '192.168.1.67',
body: {
name: 'Juan Manuel',
lastname: 'Batty Linero'
},
response: {
message: 'User created'
},
...
})
logger({
transactionDate: Date.now(),
...
})
'use strict'
import NodeLogger from '@jmbl1685/logger'
const logger = NodeLogger({
host: '{{your_mongo_connection_string}}'
})
// You can save anything in the log...
logger({
body: {
name: 'Juan Manuel',
lastname: 'Batty Linero',
state: true,
identification: 12345
}
})
Used modules
- Mongoose https://github.com/Automattic/mongoose#readme