runtimeZero
runtimeZero

Reputation: 28116

Using Logentries for logging on Heroku

I have added logentries as an add-on on Heroku. I then obtained Account key from logentries profile page.

I used this account key in my application as below:

/*  services/logger.js */

var Logger = require('le_node');

var logger = new Logger({
  token: '9a7562ac-0fba-41ba-9e02-abcdefghi'   //this is a fake key
});

module.exports = logger;

Now in my other files I am using the above as:

/* some js file */
var logger = require('../services/logger');

logger.info('Executing Game.creator.js');

When I run this script on my local machine, I expect that logging would happen on logentries and then i would see the log details..however that does not seem to be the case.

Is there something I am missing here ?

Upvotes: 0

Views: 1033

Answers (1)

Damien MATHIEU
Damien MATHIEU

Reputation: 32627

You don't need to configure anything when using logentries as an add-on on heroku.

The heroku logging platform will get all logs sent to STDOUT or STDERR by your app, and make it availbable to a few places.
The most known one being heroku logs.

It will also send those logs to any drain URL configured on your app, which logentries can automatically configure when you setup the add-on.
That means as soon as the add-on is configured, all logs sent to STDOUT or STDERR by your app will be received by logentries.

Upvotes: 1

Related Questions