0๐
I have used a 3rd party logging service like Loggly to do this. Create an account, and then you can use https://www.npmjs.com/package/loggly to setup a connection:
var loggly = require('loggly');
var client = loggly.createClient({
token: "your-really-long-input-token",
subdomain: "your-subdomain",
auth: {
username: "your-username",
password: "your-password"
}
});
And then you simply log like this:
client.log('127.0.0.1 - oops i did it again');
You then log into their service to see the log and a bunch of tools for analysis.
There are other logging services like Logzio, etc.
๐คEd Pfromer
Source:stackexchange.com