![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/lib/node_modules/forever/node_modules/broadway/lib/broadway/plugins/ |
Upload File : |
/* * exceptions.js: Plugin responsible for logging all uncaughtExceptions in a flatiron App. * * (C) 2011, Nodejitsu Inc. * MIT LICENSE * */ var winston = require('winston'), common = require('../common'); var exceptions = exports; // // ### Setup default state for the exceptions plugin // exceptions.name = 'exceptions'; exceptions.initalized = false; var defaultConfig = exceptions.defaultConfig = { console: { colorize: false, json: true, level: 'silly' } }; // // ### function attach (options) // #### @options {Object} Options for this plugin // Extends `this` the application with exception handling // functionality from `winston`. // exceptions.attach = function (options) { options = options || {}; if (this.config) { options = common.mixin({}, options, this.config.get('exceptions') || {}); } if (exceptions.initalized) { return; } var exceptionHandlers = []; // // Create the exceptionHandlers defaulting to Console and Loggly. // exceptionHandlers.push(new winston.transports.Console(options.console || defaultConfig.console)); Object.keys(options).forEach(function (name) { if (name === 'console') { return; } exceptionHandlers.push(new (winston.transports[common.capitalize(name)])(options[name])); }); // // Update the state of the plugin with the logger. // exceptions.logger = new winston.Logger({ exceptionHandlers: exceptionHandlers }); exceptions.initalized = true; // // Have the logger handle uncaught exceptions. // exceptions.logger.handleExceptions(); };