rails_semantic_logger 4.5.0 → 4.5.1

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: 073a9356b40dc5616e3e4b179ea108d7419dc9e4bba685c230e41acd93ca48d4
4
- data.tar.gz: 106766c0a81ed7a2d7b25c7810aa1edac1eedf5638426373209b168d7ea57b43
3
+ metadata.gz: bd55ff856fc246fa4fadefb8a1b82f0736ea61567fbed522697def5df5c89d29
4
+ data.tar.gz: d98db67a99d334d7c11767bc38673d68f609cece4a646bc9c73b7285194a6e95
5
5
  SHA512:
6
- metadata.gz: fd450ba87b0d22e139fd7afa626ed4fb8566e3ebc70880c05fe2c73c1ff5067a8d3626a8bddd742160a3d25eced3f8e4431e1fac96432f0fe53e6ec740c78d46
7
- data.tar.gz: 2bee7d442cab44140f00b9ca74d0b343d6e19933953487c5b21c094bea0c7f811f2bb6014090eda6a778eb1ebd8209f86a9b4c3afb471fd1fa9955ad3fc160e4
6
+ metadata.gz: d245a7a4e849914597cbc15ec55f41ec5e8e6565c8e0836a5229b51f290582a5c5d7374e8834dc4aebcbc41f0332bdd062eeb4b998261bf24e172a7e0fa89e39
7
+ data.tar.gz: 1e4de44480364eebb089eb723f3f5e361543e19384a9296189ac8d7455f541a095d15b6016516c6127efa03da9f90d17ad6c40612a7be842405a2aa602217009
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Rails Semantic Logger
2
- [![Gem Version](https://img.shields.io/gem/v/rails_semantic_logger.svg)](https://rubygems.org/gems/rails_semantic_logger) [![Build Status](https://travis-ci.org/rocketjob/rails_semantic_logger.svg?branch=master)](https://travis-ci.org/rocketjob/rails_semantic_logger) [![Downloads](https://img.shields.io/gem/dt/rails_semantic_logger.svg)](https://rubygems.org/gems/rails_semantic_logger) [![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](http://opensource.org/licenses/Apache-2.0) ![](https://img.shields.io/badge/status-Production%20Ready-blue.svg) [![Gitter chat](https://img.shields.io/badge/IRC%20(gitter)-Support-brightgreen.svg)](https://gitter.im/rocketjob/support)
2
+ [![Gem Version](https://img.shields.io/gem/v/rails_semantic_logger.svg)](https://rubygems.org/gems/rails_semantic_logger) [![Build Status](https://github.com/reidmorrison/rails_semantic_logger/workflows/build/badge.svg)](https://github.com/reidmorrison/rails_semantic_logger/actions?query=workflow%3Abuild) [![Downloads](https://img.shields.io/gem/dt/rails_semantic_logger.svg)](https://rubygems.org/gems/rails_semantic_logger) [![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](http://opensource.org/licenses/Apache-2.0) ![](https://img.shields.io/badge/status-Production%20Ready-blue.svg)
3
3
 
4
- Rails Semantic Logger replaces the Rails default logger with [Semantic Logger](http://github.com/rocketjob/semantic_logger)
4
+ Rails Semantic Logger replaces the Rails default logger with [Semantic Logger](https://logger.rocketjob.io/)
5
5
 
6
- * http://github.com/rocketjob/rails_semantic_logger
6
+ * http://github.com/reidmorrison/rails_semantic_logger
7
7
 
8
8
  ## Documentation
9
9
 
10
- For complete documentation see: http://rocketjob.github.io/semantic_logger/rails
10
+ For complete documentation see: https://logger.rocketjob.io/rails
11
11
 
12
12
  ## Upgrading to Semantic Logger v4.4
13
13
 
@@ -21,13 +21,13 @@ SemanticLogger::Processor.instance.instance_variable_set(:@queue, Queue.new)
21
21
 
22
22
  ## Supports
23
23
 
24
- For the complete list of supported Ruby and Rails versions, see the [Testing file](https://github.com/rocketjob/rails_semantic_logger/blob/master/.travis.yml).
24
+ For the complete list of supported Ruby and Rails versions, see the [Testing file](https://github.com/reidmorrison/rails_semantic_logger/blob/master/.travis.yml).
25
25
 
26
26
  ## Author
27
27
 
28
28
  [Reid Morrison](https://github.com/reidmorrison)
29
29
 
30
- [Contributors](https://github.com/rocketjob/rails_semantic_logger/graphs/contributors)
30
+ [Contributors](https://github.com/reidmorrison/rails_semantic_logger/graphs/contributors)
31
31
 
32
32
  ## Versioning
33
33
 
@@ -15,10 +15,10 @@ module RailsSemanticLogger
15
15
  # Unused, but needed for Devise 401 status code monkey patch to still work.
16
16
  ::ActionController::Base.log_process_action(payload)
17
17
 
18
- # According to PR https://github.com/rocketjob/rails_semantic_logger/pull/37/files
18
+ # According to PR https://github.com/reidmorrison/rails_semantic_logger/pull/37/files
19
19
  # payload[:params] is not always a Hash.
20
20
  payload[:params] = payload[:params].to_unsafe_h unless payload[:params].is_a?(Hash)
21
- payload[:params].except!(*INTERNAL_PARAMS)
21
+ payload[:params] = payload[:params].except(*INTERNAL_PARAMS)
22
22
  payload.delete(:params) if payload[:params].empty?
23
23
 
24
24
  format = payload[:format]
@@ -40,7 +40,7 @@ module RailsSemanticLogger
40
40
  partial: from_rails_root(event.payload[:identifier])
41
41
  }
42
42
  payload[:within] = from_rails_root(event.payload[:layout]) if event.payload[:layout]
43
- payload[:cache] = payload[:cache_hit] unless event.payload[:cache_hit].nil?
43
+ payload[:cache] = event.payload[:cache_hit] unless event.payload[:cache_hit].nil?
44
44
  payload[:allocations] = event.allocations if event.respond_to?(:allocations)
45
45
 
46
46
  logger.measure(
@@ -60,7 +60,7 @@ module RailsSemanticLogger
60
60
  template: from_rails_root(identifier),
61
61
  count: event.payload[:count]
62
62
  }
63
- payload[:cache_hits] = payload[:cache_hits] if payload[:cache_hits]
63
+ payload[:cache_hits] = event.payload[:cache_hits] if event.payload[:cache_hits]
64
64
  payload[:allocations] = event.allocations if event.respond_to?(:allocations)
65
65
 
66
66
  logger.measure(
@@ -32,6 +32,7 @@ module RailsSemanticLogger
32
32
  log_payload = {sql: payload[:sql]}
33
33
  log_payload[:binds] = bind_values(payload) unless (payload[:binds] || []).empty?
34
34
  log_payload[:allocations] = event.allocations if event.respond_to?(:allocations)
35
+ log_payload[:cached] = event.payload[:cached]
35
36
 
36
37
  log = {
37
38
  message: name,
@@ -127,18 +127,20 @@ module RailsSemanticLogger
127
127
 
128
128
  # After any initializers run, but after the gems have been loaded
129
129
  config.after_initialize do
130
+ config = Rails.application.config
131
+
130
132
  # Replace the Bugsnag logger
131
- Bugsnag.configure { |config| config.logger = SemanticLogger[Bugsnag] } if defined?(Bugsnag)
133
+ Bugsnag.configure { |bugsnag_config| bugsnag_config.logger = SemanticLogger[Bugsnag] } if defined?(Bugsnag)
132
134
 
133
135
  # Rails Patches
134
- require("rails_semantic_logger/extensions/action_cable/tagged_logger_proxy") if defined?(ActionCable)
135
- require("rails_semantic_logger/extensions/action_controller/live") if defined?(ActionController::Live)
136
- require("rails_semantic_logger/extensions/action_dispatch/debug_exceptions") if defined?(ActionDispatch::DebugExceptions)
137
- if defined?(ActionView::StreamingTemplateRenderer::Body)
136
+ require("rails_semantic_logger/extensions/action_cable/tagged_logger_proxy") if defined?(::ActionCable)
137
+ require("rails_semantic_logger/extensions/action_controller/live") if defined?(::ActionController::Live)
138
+ require("rails_semantic_logger/extensions/action_dispatch/debug_exceptions") if defined?(::ActionDispatch::DebugExceptions)
139
+ if defined?(::ActionView::StreamingTemplateRenderer::Body)
138
140
  require("rails_semantic_logger/extensions/action_view/streaming_template_renderer")
139
141
  end
140
142
  require("rails_semantic_logger/extensions/active_job/logging") if defined?(::ActiveJob)
141
- require("rails_semantic_logger/extensions/active_model_serializers/logging") if defined?(ActiveModelSerializers)
143
+ require("rails_semantic_logger/extensions/active_model_serializers/logging") if defined?(::ActiveModelSerializers)
142
144
 
143
145
  if config.rails_semantic_logger.semantic
144
146
  # Active Job
@@ -174,7 +176,8 @@ module RailsSemanticLogger
174
176
 
175
177
  # Silence asset logging by applying a filter to the Rails logger itself, not any of the appenders.
176
178
  if config.rails_semantic_logger.quiet_assets && config.assets.prefix
177
- assets_regex = %r(\A/{0,2}#{config.assets.prefix})
179
+ assets_root = config.relative_url_root.to_s + config.assets.prefix
180
+ assets_regex = %r(\A/{0,2}#{assets_root})
178
181
  RailsSemanticLogger::Rack::Logger.logger.filter = ->(log) { log.payload[:path] !~ assets_regex if log.payload }
179
182
  end
180
183
 
@@ -54,7 +54,7 @@ module RailsSemanticLogger
54
54
  payload: {
55
55
  method: request.request_method,
56
56
  path: request.filtered_path,
57
- ip: request.ip
57
+ ip: request.remote_ip
58
58
  }
59
59
  }
60
60
  end
@@ -1,3 +1,3 @@
1
1
  module RailsSemanticLogger
2
- VERSION = "4.5.0".freeze
2
+ VERSION = "4.5.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-24 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -54,7 +54,6 @@ dependencies:
54
54
  version: '4.4'
55
55
  description:
56
56
  email:
57
- - reidmo@gmail.com
58
57
  executables: []
59
58
  extensions: []
60
59
  extra_rdoc_files: []
@@ -79,7 +78,7 @@ files:
79
78
  - lib/rails_semantic_logger/options.rb
80
79
  - lib/rails_semantic_logger/rack/logger.rb
81
80
  - lib/rails_semantic_logger/version.rb
82
- homepage: https://github.com/rocketjob/rails_semantic_logger
81
+ homepage: https://logger.rocketjob.io
83
82
  licenses:
84
83
  - Apache-2.0
85
84
  metadata: {}
@@ -98,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
97
  - !ruby/object:Gem::Version
99
98
  version: '0'
100
99
  requirements: []
101
- rubygems_version: 3.2.3
100
+ rubygems_version: 3.2.15
102
101
  signing_key:
103
102
  specification_version: 4
104
103
  summary: Feature rich logging framework that replaces the Rails logger.