Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A winston log transport for CrashLog
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.npmignore
.travis.yml
LICENSE-MIT
README.md
crashlogtest.js
grunt.js
httpTestServer.js
package.json

README.md

winston-crashlog

Winston transport for the crashlog.io service.

Build Status

Getting Started

Install the module with: npm install winston-crashlog

Using Crashlog from within Express

To enable logging to Crashlog via winston in express you will need the following modules.

  • winston
  • express-winston
  • winston-crashlog

Below is a fragment from an express application illustrating it's configuration along side the console logger, note in this example the accessKeyId and accessKeySecret are configured outside this code and loaded with nconf.

module.exports = function (app, configurations, express) {

    var winston = require('winston');
    var expressWinston = require('express-winston');
    var CrashLog = require('winston-crashlog').CrashLog;

    ...
    app.use(expressWinston.errorLogger({
        transports:[
            new winston.transports.Console({
                json:true,
                colorize:true
            }),
            new CrashLog({debug:true, accessKeyId:nconf.get('accessKeyId'), accessKeySecret:nconf.get('accessKeySecret') })
        ]
    }));
    ...

    return app;
}

Testing

I have included a small test program named httptest.js, to use it:

Create a directory in your home called .crashlog then add a file containing the credentials from your crash log project.

exports.creds = {'accessKeyId': 'XXXX', 'accessKeySecret': 'XXX'};

Then simply run use node to run the script.

node crashlogtest.js

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

(Nothing yet)

License

Copyright (c) 2012 Mark Wolfe
Licensed under the MIT license.

Something went wrong with that request. Please try again.