storelogs
v1.0.0
Published
Storing logs from frontend in uhray boilerplate
Downloads
2
Readme
Store Logs
=========
Storing logs from frontend in Uhray Boilerplate.
Installation
Backend
npm install --save storelogs
Frontend
bower install --save storelogs
Then setup RequireJS to have crud and to point storelogs at dist/storelogs.js.
Usage
Backend
var crud = require('node-crud'),
mongoose = require('mongoose');
// pass in the crud and mongoose objects from your app
require('storelogs')(crud, mongoose);
Now it's setup.
Frontend
define(['storelogs'], function(storelogs) {
storelogs.debug('my message', { here: 'is', some: 'data' });
storelogs.log('my message', { here: 'is', some: 'data' });
storelogs.warn('my message', { here: 'is', some: 'data' });
storelogs.error('my message', { here: 'is', some: 'data' });
});
The default URL it pings for storing logs is /api/storelogs
, but if you need to change that you can call storelogs._setPath('my/new/path')
.