honeybadger 5.0.2 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +713 -701
  3. data/LICENSE +19 -19
  4. data/README.md +57 -57
  5. data/TROUBLESHOOTING.md +3 -3
  6. data/bin/honeybadger +5 -5
  7. data/lib/honeybadger/agent.rb +488 -488
  8. data/lib/honeybadger/backend/base.rb +116 -116
  9. data/lib/honeybadger/backend/debug.rb +22 -22
  10. data/lib/honeybadger/backend/null.rb +29 -29
  11. data/lib/honeybadger/backend/server.rb +62 -62
  12. data/lib/honeybadger/backend/test.rb +46 -46
  13. data/lib/honeybadger/backend.rb +27 -27
  14. data/lib/honeybadger/backtrace.rb +181 -181
  15. data/lib/honeybadger/breadcrumbs/active_support.rb +119 -119
  16. data/lib/honeybadger/breadcrumbs/breadcrumb.rb +53 -53
  17. data/lib/honeybadger/breadcrumbs/collector.rb +82 -82
  18. data/lib/honeybadger/breadcrumbs/logging.rb +51 -51
  19. data/lib/honeybadger/breadcrumbs/ring_buffer.rb +44 -44
  20. data/lib/honeybadger/breadcrumbs.rb +8 -8
  21. data/lib/honeybadger/cli/deploy.rb +43 -43
  22. data/lib/honeybadger/cli/exec.rb +143 -143
  23. data/lib/honeybadger/cli/helpers.rb +28 -28
  24. data/lib/honeybadger/cli/heroku.rb +129 -129
  25. data/lib/honeybadger/cli/install.rb +101 -101
  26. data/lib/honeybadger/cli/main.rb +237 -237
  27. data/lib/honeybadger/cli/notify.rb +67 -67
  28. data/lib/honeybadger/cli/test.rb +267 -267
  29. data/lib/honeybadger/cli.rb +14 -14
  30. data/lib/honeybadger/config/defaults.rb +336 -333
  31. data/lib/honeybadger/config/env.rb +42 -42
  32. data/lib/honeybadger/config/ruby.rb +146 -146
  33. data/lib/honeybadger/config/yaml.rb +76 -76
  34. data/lib/honeybadger/config.rb +413 -413
  35. data/lib/honeybadger/const.rb +20 -20
  36. data/lib/honeybadger/context_manager.rb +55 -55
  37. data/lib/honeybadger/conversions.rb +16 -16
  38. data/lib/honeybadger/init/rails.rb +38 -38
  39. data/lib/honeybadger/init/rake.rb +66 -66
  40. data/lib/honeybadger/init/ruby.rb +11 -11
  41. data/lib/honeybadger/init/sinatra.rb +51 -51
  42. data/lib/honeybadger/logging.rb +177 -177
  43. data/lib/honeybadger/notice.rb +579 -568
  44. data/lib/honeybadger/plugin.rb +210 -210
  45. data/lib/honeybadger/plugins/breadcrumbs.rb +111 -111
  46. data/lib/honeybadger/plugins/delayed_job/plugin.rb +56 -56
  47. data/lib/honeybadger/plugins/delayed_job.rb +22 -22
  48. data/lib/honeybadger/plugins/faktory.rb +52 -52
  49. data/lib/honeybadger/plugins/lambda.rb +71 -71
  50. data/lib/honeybadger/plugins/local_variables.rb +44 -44
  51. data/lib/honeybadger/plugins/passenger.rb +23 -23
  52. data/lib/honeybadger/plugins/rails.rb +72 -63
  53. data/lib/honeybadger/plugins/resque.rb +72 -72
  54. data/lib/honeybadger/plugins/shoryuken.rb +52 -52
  55. data/lib/honeybadger/plugins/sidekiq.rb +71 -62
  56. data/lib/honeybadger/plugins/sucker_punch.rb +18 -18
  57. data/lib/honeybadger/plugins/thor.rb +32 -32
  58. data/lib/honeybadger/plugins/warden.rb +19 -19
  59. data/lib/honeybadger/rack/error_notifier.rb +92 -92
  60. data/lib/honeybadger/rack/user_feedback.rb +88 -88
  61. data/lib/honeybadger/rack/user_informer.rb +45 -45
  62. data/lib/honeybadger/ruby.rb +2 -2
  63. data/lib/honeybadger/singleton.rb +103 -103
  64. data/lib/honeybadger/tasks.rb +22 -22
  65. data/lib/honeybadger/templates/feedback_form.erb +84 -84
  66. data/lib/honeybadger/util/http.rb +92 -92
  67. data/lib/honeybadger/util/lambda.rb +32 -32
  68. data/lib/honeybadger/util/request_hash.rb +73 -73
  69. data/lib/honeybadger/util/request_payload.rb +41 -41
  70. data/lib/honeybadger/util/revision.rb +39 -39
  71. data/lib/honeybadger/util/sanitizer.rb +214 -214
  72. data/lib/honeybadger/util/sql.rb +34 -34
  73. data/lib/honeybadger/util/stats.rb +50 -50
  74. data/lib/honeybadger/version.rb +4 -4
  75. data/lib/honeybadger/worker.rb +253 -253
  76. data/lib/honeybadger.rb +11 -11
  77. data/resources/ca-bundle.crt +3376 -3376
  78. data/vendor/capistrano-honeybadger/lib/capistrano/honeybadger.rb +5 -5
  79. data/vendor/capistrano-honeybadger/lib/capistrano/tasks/deploy.cap +89 -89
  80. data/vendor/capistrano-honeybadger/lib/honeybadger/capistrano/legacy.rb +47 -47
  81. data/vendor/capistrano-honeybadger/lib/honeybadger/capistrano.rb +2 -2
  82. data/vendor/cli/inifile.rb +628 -628
  83. data/vendor/cli/thor/actions/create_file.rb +103 -103
  84. data/vendor/cli/thor/actions/create_link.rb +59 -59
  85. data/vendor/cli/thor/actions/directory.rb +118 -118
  86. data/vendor/cli/thor/actions/empty_directory.rb +135 -135
  87. data/vendor/cli/thor/actions/file_manipulation.rb +316 -316
  88. data/vendor/cli/thor/actions/inject_into_file.rb +107 -107
  89. data/vendor/cli/thor/actions.rb +319 -319
  90. data/vendor/cli/thor/base.rb +656 -656
  91. data/vendor/cli/thor/command.rb +133 -133
  92. data/vendor/cli/thor/core_ext/hash_with_indifferent_access.rb +77 -77
  93. data/vendor/cli/thor/core_ext/io_binary_read.rb +10 -10
  94. data/vendor/cli/thor/core_ext/ordered_hash.rb +98 -98
  95. data/vendor/cli/thor/error.rb +32 -32
  96. data/vendor/cli/thor/group.rb +281 -281
  97. data/vendor/cli/thor/invocation.rb +178 -178
  98. data/vendor/cli/thor/line_editor/basic.rb +35 -35
  99. data/vendor/cli/thor/line_editor/readline.rb +88 -88
  100. data/vendor/cli/thor/line_editor.rb +17 -17
  101. data/vendor/cli/thor/parser/argument.rb +73 -73
  102. data/vendor/cli/thor/parser/arguments.rb +175 -175
  103. data/vendor/cli/thor/parser/option.rb +125 -125
  104. data/vendor/cli/thor/parser/options.rb +218 -218
  105. data/vendor/cli/thor/parser.rb +4 -4
  106. data/vendor/cli/thor/rake_compat.rb +71 -71
  107. data/vendor/cli/thor/runner.rb +322 -322
  108. data/vendor/cli/thor/shell/basic.rb +421 -421
  109. data/vendor/cli/thor/shell/color.rb +149 -149
  110. data/vendor/cli/thor/shell/html.rb +126 -126
  111. data/vendor/cli/thor/shell.rb +81 -81
  112. data/vendor/cli/thor/util.rb +267 -267
  113. data/vendor/cli/thor/version.rb +3 -3
  114. data/vendor/cli/thor.rb +484 -484
  115. metadata +10 -5
@@ -1,56 +1,56 @@
1
- require 'delayed_job'
2
- require 'honeybadger/ruby'
3
-
4
- module Honeybadger
5
- module Plugins
6
- module DelayedJob
7
- class Plugin < ::Delayed::Plugin
8
- callbacks do |lifecycle|
9
- lifecycle.around(:invoke_job) do |job, &block|
10
- begin
11
-
12
- begin
13
- if job.payload_object.class.name == 'ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper'
14
- #buildin support for Rails 4.2 ActiveJob
15
- component = job.payload_object.job_data['job_class']
16
- action = 'perform'
17
- else
18
- #buildin support for Delayed::PerformableMethod
19
- component = job.payload_object.object.is_a?(Class) ? job.payload_object.object.name : job.payload_object.object.class.name
20
- action = job.payload_object.method_name.to_s
21
- end
22
- rescue #fallback to support all other classes
23
- component = job.payload_object.class.name
24
- action = 'perform'
25
- end
26
-
27
- ::Honeybadger.context(
28
- :component => component,
29
- :action => action,
30
- :job_id => job.id,
31
- :handler => job.handler,
32
- :last_error => job.last_error,
33
- :attempts => job.attempts,
34
- :queue => job.queue
35
- )
36
-
37
- block.call(job)
38
- rescue Exception => error
39
- ::Honeybadger.notify(
40
- :component => component,
41
- :action => action,
42
- :error_class => error.class.name,
43
- :error_message => "#{ error.class.name }: #{ error.message }",
44
- :backtrace => error.backtrace,
45
- :exception => error
46
- ) if job.attempts.to_i >= ::Honeybadger.config[:'delayed_job.attempt_threshold'].to_i
47
- raise error
48
- ensure
49
- ::Honeybadger.clear!
50
- end
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
1
+ require 'delayed_job'
2
+ require 'honeybadger/ruby'
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module DelayedJob
7
+ class Plugin < ::Delayed::Plugin
8
+ callbacks do |lifecycle|
9
+ lifecycle.around(:invoke_job) do |job, &block|
10
+ begin
11
+
12
+ begin
13
+ if job.payload_object.class.name == 'ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper'
14
+ #buildin support for Rails 4.2 ActiveJob
15
+ component = job.payload_object.job_data['job_class']
16
+ action = 'perform'
17
+ else
18
+ #buildin support for Delayed::PerformableMethod
19
+ component = job.payload_object.object.is_a?(Class) ? job.payload_object.object.name : job.payload_object.object.class.name
20
+ action = job.payload_object.method_name.to_s
21
+ end
22
+ rescue #fallback to support all other classes
23
+ component = job.payload_object.class.name
24
+ action = 'perform'
25
+ end
26
+
27
+ ::Honeybadger.context(
28
+ :component => component,
29
+ :action => action,
30
+ :job_id => job.id,
31
+ :handler => job.handler,
32
+ :last_error => job.last_error,
33
+ :attempts => job.attempts,
34
+ :queue => job.queue
35
+ )
36
+
37
+ block.call(job)
38
+ rescue Exception => error
39
+ ::Honeybadger.notify(
40
+ :component => component,
41
+ :action => action,
42
+ :error_class => error.class.name,
43
+ :error_message => "#{ error.class.name }: #{ error.message }",
44
+ :backtrace => error.backtrace,
45
+ :exception => error
46
+ ) if job.attempts.to_i >= ::Honeybadger.config[:'delayed_job.attempt_threshold'].to_i
47
+ raise error
48
+ ensure
49
+ ::Honeybadger.clear!
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -1,22 +1,22 @@
1
- require 'honeybadger/plugin'
2
-
3
- module Honeybadger
4
- Plugin.register do
5
- requirement { defined?(::Delayed::Plugin) }
6
- requirement { defined?(::Delayed::Worker.plugins) }
7
- requirement do
8
- if delayed_job_honeybadger = defined?(::Delayed::Plugins::Honeybadger)
9
- logger.warn("Support for Delayed Job has been moved " \
10
- "to the honeybadger gem. Please remove " \
11
- "delayed_job_honeybadger from your " \
12
- "Gemfile.")
13
- end
14
- !delayed_job_honeybadger
15
- end
16
-
17
- execution do
18
- require 'honeybadger/plugins/delayed_job/plugin'
19
- ::Delayed::Worker.plugins << Plugins::DelayedJob::Plugin
20
- end
21
- end
22
- end
1
+ require 'honeybadger/plugin'
2
+
3
+ module Honeybadger
4
+ Plugin.register do
5
+ requirement { defined?(::Delayed::Plugin) }
6
+ requirement { defined?(::Delayed::Worker.plugins) }
7
+ requirement do
8
+ if delayed_job_honeybadger = defined?(::Delayed::Plugins::Honeybadger)
9
+ logger.warn("Support for Delayed Job has been moved " \
10
+ "to the honeybadger gem. Please remove " \
11
+ "delayed_job_honeybadger from your " \
12
+ "Gemfile.")
13
+ end
14
+ !delayed_job_honeybadger
15
+ end
16
+
17
+ execution do
18
+ require 'honeybadger/plugins/delayed_job/plugin'
19
+ ::Delayed::Worker.plugins << Plugins::DelayedJob::Plugin
20
+ end
21
+ end
22
+ end
@@ -1,52 +1,52 @@
1
- require 'honeybadger/plugin'
2
- require 'honeybadger/ruby'
3
-
4
- module Honeybadger
5
- module Plugins
6
- module Faktory
7
- class Middleware
8
- def call(worker, job)
9
- Honeybadger.clear!
10
- yield
11
- end
12
- end
13
-
14
- Plugin.register do
15
- requirement { defined?(::Faktory) }
16
-
17
- execution do
18
- ::Faktory.configure_worker do |faktory|
19
- faktory.worker_middleware do |chain|
20
- chain.prepend Middleware
21
- end
22
- end
23
-
24
- ::Faktory.configure_worker do |faktory|
25
- faktory.error_handlers << lambda do |ex, params|
26
- opts = {parameters: params}
27
-
28
- if job = params[:job]
29
- if (threshold = config[:'faktory.attempt_threshold'].to_i) > 0
30
- # If job.failure is nil, it is the first attempt. The first
31
- # retry has a job.failure.retry_count of 0, which would be
32
- # the second attempt in our case.
33
- retry_count = job.dig('failure', 'retry_count')
34
- attempt = retry_count ? retry_count + 1 : 0
35
-
36
- limit = [job['retry'].to_i, threshold].min
37
-
38
- return if attempt < limit
39
- end
40
-
41
- opts[:component] = job['jobtype']
42
- opts[:action] = 'perform'
43
- end
44
-
45
- Honeybadger.notify(ex, opts)
46
- end
47
- end
48
- end
49
- end
50
- end
51
- end
52
- end
1
+ require 'honeybadger/plugin'
2
+ require 'honeybadger/ruby'
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module Faktory
7
+ class Middleware
8
+ def call(worker, job)
9
+ Honeybadger.clear!
10
+ yield
11
+ end
12
+ end
13
+
14
+ Plugin.register do
15
+ requirement { defined?(::Faktory) }
16
+
17
+ execution do
18
+ ::Faktory.configure_worker do |faktory|
19
+ faktory.worker_middleware do |chain|
20
+ chain.prepend Middleware
21
+ end
22
+ end
23
+
24
+ ::Faktory.configure_worker do |faktory|
25
+ faktory.error_handlers << lambda do |ex, params|
26
+ opts = {parameters: params}
27
+
28
+ if job = params[:job]
29
+ if (threshold = config[:'faktory.attempt_threshold'].to_i) > 0
30
+ # If job.failure is nil, it is the first attempt. The first
31
+ # retry has a job.failure.retry_count of 0, which would be
32
+ # the second attempt in our case.
33
+ retry_count = job.dig('failure', 'retry_count')
34
+ attempt = retry_count ? retry_count + 1 : 0
35
+
36
+ limit = [job['retry'].to_i, threshold].min
37
+
38
+ return if attempt < limit
39
+ end
40
+
41
+ opts[:component] = job['jobtype']
42
+ opts[:action] = 'perform'
43
+ end
44
+
45
+ Honeybadger.notify(ex, opts)
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,71 +1,71 @@
1
- require 'honeybadger/plugin'
2
- require 'honeybadger/util/lambda'
3
-
4
- module Honeybadger
5
- module Plugins
6
- module LambdaExtension
7
- # Wrap Lambda handlers so exceptions can be automatically captured
8
- #
9
- # Usage:
10
- #
11
- # # Automatically included in the top-level main object
12
- # hb_wrap_handler :my_handler_1, :my_handler_2
13
- #
14
- # def my_handler_1(event:, context:)
15
- # end
16
- #
17
- # class MyLambdaApp
18
- # extend ::Honeybadger::Plugins::LambdaExtension
19
- #
20
- # hb_wrap_handler :my_handler_1, :my_handler_2
21
- #
22
- # def self.my_handler_1(event:, context:)
23
- # end
24
- # end
25
- def hb_wrap_handler(*handler_names)
26
- mod = Module.new do
27
- handler_names.each do |handler|
28
- define_method(handler) do |event:, context:|
29
- begin
30
- Honeybadger.context(aws_request_id: context.aws_request_id) if context.respond_to?(:aws_request_id)
31
-
32
- super(event: event, context: context)
33
- rescue => e
34
- Honeybadger.notify(e)
35
- raise
36
- end
37
- end
38
- end
39
- end
40
-
41
- self.singleton_class.prepend(mod)
42
- Kernel.singleton_class.prepend(mod) if self == TOPLEVEL_BINDING.eval("self")
43
- end
44
- end
45
-
46
- # @api private
47
- Plugin.register :lambda do
48
- requirement { Util::Lambda.lambda_execution? }
49
-
50
- execution do
51
- config[:sync] = true
52
- config[:'exceptions.notify_at_exit'] = false
53
-
54
- main = TOPLEVEL_BINDING.eval("self")
55
- main.extend(LambdaExtension)
56
-
57
- (config[:before_notify] ||= []) << lambda do |notice|
58
- data = Util::Lambda.normalized_data
59
-
60
- notice.component = data["function"]
61
- notice.action = data["handler"]
62
- notice.details["Lambda Details"] = data
63
-
64
- if (trace_id = Util::Lambda.trace_id)
65
- notice.context[:lambda_trace_id] = trace_id
66
- end
67
- end
68
- end
69
- end
70
- end
71
- end
1
+ require 'honeybadger/plugin'
2
+ require 'honeybadger/util/lambda'
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module LambdaExtension
7
+ # Wrap Lambda handlers so exceptions can be automatically captured
8
+ #
9
+ # Usage:
10
+ #
11
+ # # Automatically included in the top-level main object
12
+ # hb_wrap_handler :my_handler_1, :my_handler_2
13
+ #
14
+ # def my_handler_1(event:, context:)
15
+ # end
16
+ #
17
+ # class MyLambdaApp
18
+ # extend ::Honeybadger::Plugins::LambdaExtension
19
+ #
20
+ # hb_wrap_handler :my_handler_1, :my_handler_2
21
+ #
22
+ # def self.my_handler_1(event:, context:)
23
+ # end
24
+ # end
25
+ def hb_wrap_handler(*handler_names)
26
+ mod = Module.new do
27
+ handler_names.each do |handler|
28
+ define_method(handler) do |event:, context:|
29
+ begin
30
+ Honeybadger.context(aws_request_id: context.aws_request_id) if context.respond_to?(:aws_request_id)
31
+
32
+ super(event: event, context: context)
33
+ rescue => e
34
+ Honeybadger.notify(e)
35
+ raise
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ self.singleton_class.prepend(mod)
42
+ Kernel.singleton_class.prepend(mod) if self == TOPLEVEL_BINDING.eval("self")
43
+ end
44
+ end
45
+
46
+ # @api private
47
+ Plugin.register :lambda do
48
+ requirement { Util::Lambda.lambda_execution? }
49
+
50
+ execution do
51
+ config[:sync] = true
52
+ config[:'exceptions.notify_at_exit'] = false
53
+
54
+ main = TOPLEVEL_BINDING.eval("self")
55
+ main.extend(LambdaExtension)
56
+
57
+ (config[:before_notify] ||= []) << lambda do |notice|
58
+ data = Util::Lambda.normalized_data
59
+
60
+ notice.component = data["function"]
61
+ notice.action = data["handler"]
62
+ notice.details["Lambda Details"] = data
63
+
64
+ if (trace_id = Util::Lambda.trace_id)
65
+ notice.context[:lambda_trace_id] = trace_id
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -1,44 +1,44 @@
1
- require 'honeybadger/plugin'
2
- require 'honeybadger/backtrace'
3
-
4
- module Honeybadger
5
- module Plugins
6
- module LocalVariables
7
- module ExceptionExtension
8
- def self.included(base)
9
- base.send(:alias_method, :set_backtrace_without_honeybadger, :set_backtrace)
10
- base.send(:alias_method, :set_backtrace, :set_backtrace_with_honeybadger)
11
- end
12
-
13
- def set_backtrace_with_honeybadger(*args, &block)
14
- if caller.none? { |loc| loc.match(::Honeybadger::Backtrace::Line::INPUT_FORMAT) && Regexp.last_match(1) == __FILE__ }
15
- @__honeybadger_bindings_stack = binding.callers.drop(1)
16
- end
17
-
18
- set_backtrace_without_honeybadger(*args, &block)
19
- end
20
-
21
- def __honeybadger_bindings_stack
22
- @__honeybadger_bindings_stack || []
23
- end
24
- end
25
-
26
- Plugin.register do
27
- requirement { config[:'exceptions.local_variables'] }
28
- requirement { defined?(::BindingOfCaller) }
29
- requirement do
30
- if res = defined?(::BetterErrors)
31
- logger.warn("The local variables feature is incompatible with the " \
32
- "better_errors gem; to remove this warning, set " \
33
- "exceptions.local_variables to false for environments " \
34
- "which load better_errors.")
35
- end
36
- !res
37
- end
38
- requirement { !::Exception.included_modules.include?(ExceptionExtension) }
39
-
40
- execution { ::Exception.send(:include, ExceptionExtension) }
41
- end
42
- end
43
- end
44
- end
1
+ require 'honeybadger/plugin'
2
+ require 'honeybadger/backtrace'
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module LocalVariables
7
+ module ExceptionExtension
8
+ def self.included(base)
9
+ base.send(:alias_method, :set_backtrace_without_honeybadger, :set_backtrace)
10
+ base.send(:alias_method, :set_backtrace, :set_backtrace_with_honeybadger)
11
+ end
12
+
13
+ def set_backtrace_with_honeybadger(*args, &block)
14
+ if caller.none? { |loc| loc.match(::Honeybadger::Backtrace::Line::INPUT_FORMAT) && Regexp.last_match(1) == __FILE__ }
15
+ @__honeybadger_bindings_stack = binding.callers.drop(1)
16
+ end
17
+
18
+ set_backtrace_without_honeybadger(*args, &block)
19
+ end
20
+
21
+ def __honeybadger_bindings_stack
22
+ @__honeybadger_bindings_stack || []
23
+ end
24
+ end
25
+
26
+ Plugin.register do
27
+ requirement { config[:'exceptions.local_variables'] }
28
+ requirement { defined?(::BindingOfCaller) }
29
+ requirement do
30
+ if res = defined?(::BetterErrors)
31
+ logger.warn("The local variables feature is incompatible with the " \
32
+ "better_errors gem; to remove this warning, set " \
33
+ "exceptions.local_variables to false for environments " \
34
+ "which load better_errors.")
35
+ end
36
+ !res
37
+ end
38
+ requirement { !::Exception.included_modules.include?(ExceptionExtension) }
39
+
40
+ execution { ::Exception.send(:include, ExceptionExtension) }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,23 +1,23 @@
1
- require 'honeybadger/plugin'
2
- require 'honeybadger/agent'
3
-
4
- module Honeybadger
5
- module Plugins
6
- module Passenger
7
- Plugin.register do
8
- requirement { defined?(::PhusionPassenger.on_event) }
9
-
10
- execution do
11
- ::PhusionPassenger.on_event(:starting_worker_process) do |forked|
12
- logger.debug('Starting passenger worker process')
13
- end
14
-
15
- ::PhusionPassenger.on_event(:stopping_worker_process) do
16
- logger.debug('Stopping passenger worker process')
17
- Honeybadger.stop
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
1
+ require 'honeybadger/plugin'
2
+ require 'honeybadger/agent'
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module Passenger
7
+ Plugin.register do
8
+ requirement { defined?(::PhusionPassenger.on_event) }
9
+
10
+ execution do
11
+ ::PhusionPassenger.on_event(:starting_worker_process) do |forked|
12
+ logger.debug('Starting passenger worker process')
13
+ end
14
+
15
+ ::PhusionPassenger.on_event(:stopping_worker_process) do
16
+ logger.debug('Stopping passenger worker process')
17
+ Honeybadger.stop
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end