Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (39 sloc) 1.86 KB

EALoggly

A node.js client wrapper for loggly.com

Dependencies

	$ [sudo] npm install loggly

##Usage Using the EALoggly wrapper is simple. Just pull the ealogger.js file from the github repo and drop it in the same folder as your node.js application.

###Configuration Next, you need to add some configuration information in order to ensure your log data goes to the correct loggly.com input. You do this by modifying the JSON for the config variable at the top of the ealogger.js file.

var config = {
  "subdomain": "your-loggly-domain",
  "user": "loggly-user-name",
  "password": "loggly-password",
  "json":true,
  "apikey":"your-crazy-long-loggly-api-key"
};

If you have any questions about these values please see the loggly.com documentation at [wiki.loggly.com] (http://wiki.loggly.com/).

Logging

Using the logger is simple. First you need to require the ealogger.js module.

var logger = require('./ealogger');

Note: The above code assumes the ealogger.js file is in the same folder as the .js file you want to log from. If it's not, adjust your path accordingly.

Now that everything is configured, logging is as simple as:

logger.log('info', 'myMachine', 'Entering the write method');

The parameter info for the log method is as follows:

logger.log(logLevel, machineName, logMessage)

Using one of the following 5 log levels makes it easier to isolate your log messages on the companion EALoggly site:
info, debug, warn, error, fatal

Questions?

That's pretty much it. Have any questions? email me don.browning@turner.com.