Skip to content

Instantly share code, notes, and snippets.

@pjanuario
Created August 5, 2014 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjanuario/713e7f46112f77adca5e to your computer and use it in GitHub Desktop.
Save pjanuario/713e7f46112f77adca5e to your computer and use it in GitHub Desktop.
LoggerAirbrakePlugin sample
var Logger = require('logger-facade-nodejs');
var LoggerAirbrakePlugin = require('logger-facade-airbrake-plugin');
console.log("Start sample of Async error Log...");
var config = {
//api key, default (null)
apiKey: "apikey",
// host, default (null)
host: "api.airbrake.io",
// port, default (80)
port: 80,
// protocol, default (http)
protocol: 'http',
// notify uncaught excpetions, default (false)
notifyUncaughtException: false,
// dev envs, default (['development', 'test'])
developmentEnvironments: ['development', 'test'],
// appVersion, default (null)
appVersion: null
};
var plugin = new LoggerAirbrakePlugin(config);
Logger.use(plugin);
console.log("Plugins: ", Logger.plugins());
var log = Logger.getLogger("Name");
log.error("Message to log %s", 'with args');
console.log("End sample...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment