Created
August 5, 2014 15:52
-
-
Save pjanuario/713e7f46112f77adca5e to your computer and use it in GitHub Desktop.
LoggerAirbrakePlugin sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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