Add some logging
There's very little logging. Unexpected events and security exceptions should be tracked somewhere that server admins can access, but application users cannot.
+1
Then we can check off T71 in SD Elements.
+1
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.
We should do this for our install. We have Sentry running in the office. Thanks for the suggestion!