ezlog 0.9.6 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 178b2810c13ba87a8a1e389a6679e14f06e4b4f05bcc0a84dea797110cfde3a7
4
- data.tar.gz: ae3e3abfbf692e3189a5d6e1bfb1efe4ec3ce064e1e61285a2c13b27922e13fe
3
+ metadata.gz: 87d8d02b49c53db6341c59ac754514278c34ba88b2aa7d2b6391dee02fddef83
4
+ data.tar.gz: db7a2efb57161bac874a8d60747d1a0b9760eda901e069efe8ea6e57beb85308
5
5
  SHA512:
6
- metadata.gz: 21d6c1fa52dd9b46bbc33fc776d139d3c7c38492cb8f7f47bcfc577c47c53a8014197712993ece0a53807646fff222acca23e803df8af74c32ee820b4b895f7c
7
- data.tar.gz: 2ba5df5dcb18e3553f97f4727556626ad386e2e2c4dc16aefe261d3502cbe33d9fc163c439da8aa3a8392359eba43f15ea5a5da7501892da7e6c7e9e149b0553
6
+ metadata.gz: e9a7279d5cb5996dbd97b0bf18101b9b176bdb0cd7e7f5a9cc0b6297fb1037243f7fe7ef145f885d8876d3627d2c2930d8ab46fd51640265837e9ab97df66417
7
+ data.tar.gz: 6e16681888b8449e75c79a2a74775e153c49e4a3f1dc9e06c5f73a9d0159ca77e03ab5cdda5bcc8f3e00b4bf4c192901976c1130fedb862af666f58da089e6ba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### 0.10.1 (2022-01-22)
2
+
3
+ [Full Changelog](https://github.com/emartech/ezlog/compare/v0.10.0...v0.10.1)
4
+
5
+ * Fix
6
+ * Fixed a bug where `ActionView::LogSubscriber` was potentially not (eager)loaded by the time we tried to detach it.
7
+ With this fix Rails 6.1 running on Ruby 3 should be fully supported.
8
+
9
+ ### 0.10.0 (2021-07-01)
10
+
11
+ [Full Changelog](https://github.com/emartech/ezlog/compare/v0.9.6...v0.10.0)
12
+
13
+ * Features & enhancements
14
+ * Do not log exceptions which are handled by Rails. Therefore you can't get false alarms from your exception notifier
15
+
1
16
  ### 0.9.6 (2021-06-30)
2
17
 
3
18
  [Full Changelog](https://github.com/emartech/ezlog/compare/v0.9.5...v0.9.6)
data/README.md CHANGED
@@ -93,6 +93,7 @@ In addition to this, Ezlog also does the following:
93
93
  * It disables Rails's default logging of uncaught errors and injects its own error logger into the application, which
94
94
  * logs 1 line per error, including the error's name and context (stack trace, etc.),
95
95
  * logs every error at ERROR level instead of the default FATAL.
96
+ * does not log exceptions which are handled by Rails (`ActionDispatch::ExceptionWrapper.rescue_responses`)
96
97
  * It disables Rails's default request logging, which logs several lines per event during the processing of an action,
97
98
  and replaces the default Rack access log with its own access log middleware. The end result is an access log that
98
99
  * contains all relevant information (request ID, method, path, params, client IP, duration and response status code), and
@@ -9,9 +9,15 @@ module Ezlog
9
9
  def call(env)
10
10
  @app.call(env)
11
11
  rescue Exception => exception
12
- @logger.error exception
12
+ @logger.error exception unless handled?(exception)
13
13
  raise
14
14
  end
15
+
16
+ private
17
+
18
+ def handled?(exception)
19
+ ActionDispatch::ExceptionWrapper.rescue_responses.key? exception.class.name
20
+ end
15
21
  end
16
22
  end
17
23
  end
data/lib/ezlog/railtie.rb CHANGED
@@ -42,7 +42,10 @@ module Ezlog
42
42
  case ::Rails::VERSION::MAJOR
43
43
  when 6
44
44
  ::ActionController::LogSubscriber.detach_from :action_controller
45
- ::ActionView::LogSubscriber.detach_from :action_view
45
+ if defined? ::ActionView
46
+ require 'action_view/log_subscriber' unless defined? ::ActionView::LogSubscriber
47
+ ::ActionView::LogSubscriber.detach_from :action_view
48
+ end
46
49
  if defined? ::ActiveRecord
47
50
  ::ActiveRecord::LogSubscriber.detach_from :active_record
48
51
  Ezlog::Rails::LogSubscriber.attach Ezlog::Rails::ActiveRecord::LogSubscriber, :active_record
@@ -70,7 +73,9 @@ module Ezlog
70
73
  ::Sidekiq.configure_server do |config|
71
74
  config.options[:job_logger] = Ezlog::Sidekiq::JobLogger
72
75
  config.error_handlers << Ezlog::Sidekiq::ErrorLogger.new
73
- config.error_handlers.delete_if { |handler| handler.is_a? ::Sidekiq::ExceptionHandler::Logger }
76
+ if defined?(::Sidekiq::ExceptionHandler) && defined?(::Sidekiq::ExceptionHandler::Logger)
77
+ config.error_handlers.delete_if { |handler| handler.is_a? ::Sidekiq::ExceptionHandler::Logger }
78
+ end
74
79
  config.death_handlers << Ezlog::Sidekiq::DeathLogger.new
75
80
  end
76
81
  end
@@ -55,3 +55,5 @@ RSpec::Matchers.define :log do
55
55
  log_output_is_expected.to include_log_message(expected).at_level(log_level)
56
56
  end
57
57
  end
58
+
59
+ RSpec::Matchers.define_negated_matcher :not_log, :log
data/lib/ezlog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ezlog
2
- VERSION = '0.9.6'
2
+ VERSION = '0.10.2'
3
3
  end
data/repo-info.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "is_in_production": true,
3
+ "is_scannable": true,
4
+ "is_critical": false,
5
+ "contact": "g-gsuite-smartinsight@emarsys.com",
6
+ "hosted": null
7
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoltan Ormandi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '5.0'
139
- description:
139
+ description:
140
140
  email:
141
141
  - zoltan.ormandi@emarsys.com
142
142
  executables: []
@@ -172,12 +172,13 @@ files:
172
172
  - lib/ezlog/sidekiq/job_logger.rb
173
173
  - lib/ezlog/version.rb
174
174
  - lib/sequel/extensions/ezlog_logging.rb
175
+ - repo-info.json
175
176
  homepage: https://github.com/emartech/ezlog
176
177
  licenses:
177
178
  - MIT
178
179
  metadata:
179
180
  changelog_uri: https://github.com/emartech/ezlog/blob/master/CHANGELOG.md
180
- post_install_message:
181
+ post_install_message:
181
182
  rdoc_options: []
182
183
  require_paths:
183
184
  - lib
@@ -192,8 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
193
  - !ruby/object:Gem::Version
193
194
  version: '0'
194
195
  requirements: []
195
- rubygems_version: 3.1.6
196
- signing_key:
196
+ rubygems_version: 3.3.7
197
+ signing_key:
197
198
  specification_version: 4
198
199
  summary: A zero-configuration logging solution for projects using Sidekiq, Rails,
199
200
  Sequel, etc.