lets-chat icon indicating copy to clipboard operation
lets-chat copied to clipboard

Add some logging

Open geoffwhittington opened this issue 11 years ago • 4 comments

There's very little logging. Unexpected events and security exceptions should be tracked somewhere that server admins can access, but application users cannot.

geoffwhittington avatar Feb 20 '15 02:02 geoffwhittington

+1

Then we can check off T71 in SD Elements.

funkaoshi avatar Feb 20 '15 02:02 funkaoshi

+1

sakalajuraj avatar Apr 10 '15 22:04 sakalajuraj

I've added Sentry for my logging and exception needs. Which you can sign up to here if you don't have an account already: https://getsentry.com/

Start by installing raven-node. First by adding to your package.json file to dependencies:

        "dependencies": {
        "raven": "*", 
        }

Now go to your terminal and do the following command:

       $ npm install

Once raven-node is installed go to your app.js file in the root of the directory and add the below:

     var raven = require('raven');
     var client = new raven.Client( 'SENTRY_DSN');

     // The below will act as your error handler for exceptions. 
     client.patchGlobal();

Your 'Sentry DSN' can be found once you've setup an account and a project by going to the documentation. Selecting your project. And your DSN address will appear where i've stated 'SENTRY_DSN'.

The documentation can be found for NodeJS here: https://app.getsentry.com/docs/platforms/node.js/

They have really good documentation. So you can customise it to your needs quite easily.

DuncanAForbes avatar Apr 22 '15 22:04 DuncanAForbes

We should do this for our install. We have Sentry running in the office. Thanks for the suggestion!

funkaoshi avatar Apr 23 '15 14:04 funkaoshi