zalamero
v1.0.0
Published
Log useful stuff from your express apps in mongodb
Downloads
2
Readme
zalamero
Log stuff in mongodb simply
npm install zalamero
Then use it inside express:
Zalamero = require('zalamero');
logger = new Zalamero({
app: 'testing-zalamero'
});
logger.log({
request: req,
object: {
message: 'Log this thing!'
}
});
The log will look like this in mongodb:
{
"_id" : ObjectId("574e1a6a70c952fd3ecc2ee4"),
"app" : "testing-zalamero",
"date" : ISODate("2016-05-31T23:12:42.713Z"),
"headers" : {
"host" : "localhost:3000",
"connection" : "keep-alive",
"cache-control" : "max-age=0",
"accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"upgrade-insecure-requests" : "1",
"user-agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
"dnt" : "1",
"accept-encoding" : "gzip, deflate, sdch",
"accept-language" : "en-US,en;q=0.8,es;q=0.6"
},
"ip" : "::1",
"object" : {
"message" : "Log this thing!"
}
}