rails_semantic_logger 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5aa36bc6a14a428bb4e8696d67ddfec0c203528b
4
- data.tar.gz: e35114817863fc705f24215c50ed1a287322f5cb
3
+ metadata.gz: 7eb8148ab17de1d3ffe25b677bc9d5d15ab222e7
4
+ data.tar.gz: a332f3ef9f011efd32a89576db64fae6fe964761
5
5
  SHA512:
6
- metadata.gz: 6eef57d395c3fbbc61f65d692a86bc41af8302854fdd97dc07c6edf845e6ee45bade7011235fb1bc5ece8f4314bf4ca5a8e042c8a5d54750d2fde782410fcbd2
7
- data.tar.gz: 6d61557165ae2c19a6c5aa0c2bbc332694e24f64ea32ee3c415e9b1b0f81eb4e7814f3bb08138a66255c4335fe709623587e03abf3b88cfa00c5507c972abe67
6
+ metadata.gz: 6af4d6cd79f0f381f592e415fe2fbdf7e6529ec616065fde3e61348b88e6abe3d7787261138146eb48492e70b74e4c7f80342a950e6937e4d3370012ca02bf03
7
+ data.tar.gz: 122df31e2956566be5e66365bd7a42d23d38b758d890228b830b52cdf30549ecac8eab75e225a49f54085101dd760205e18c437e6da8ba368d0f4bb7585da209
@@ -22,7 +22,12 @@ module RailsSemanticLogger #:nodoc:
22
22
  #
23
23
  # Loaded after Rails logging is initialized since SemanticLogger will continue
24
24
  # to forward logging to the Rails Logger
25
- initializer :initialize_semantic_logger, :before => :initialize_logger do
25
+
26
+ # Stop standard rails logger initializer from running, since the following line causes problems:
27
+ # Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)
28
+ Rails::Application::Bootstrap.initializers.delete_if{|i| i.name == :initialize_logger}
29
+
30
+ initializer :initialize_logger, group: :all do
26
31
  config = Rails.application.config
27
32
 
28
33
  # Set the default log level based on the Rails config
@@ -68,6 +73,9 @@ module RailsSemanticLogger #:nodoc:
68
73
  ActiveSupport.on_load(:active_record) { self.logger = SemanticLogger['ActiveRecord'] }
69
74
  ActiveSupport.on_load(:action_controller) { self.logger = SemanticLogger['ActionController'] }
70
75
  ActiveSupport.on_load(:action_mailer) { self.logger = SemanticLogger['ActionMailer'] }
76
+
77
+ # Rails 4 is overwriting existing values for the logger, unless set via config
78
+ config.action_controller.logger = SemanticLogger['ActionController']
71
79
  end
72
80
 
73
81
  # Support fork frameworks
@@ -93,7 +101,10 @@ module RailsSemanticLogger #:nodoc:
93
101
  Moped.logger = SemanticLogger[Moped] if defined?(Moped)
94
102
 
95
103
  # Replace the Resque Logger
96
- Resque.logger = SemanticLogger[Resque] if defined?(Resque)
104
+ Resque.logger = SemanticLogger[Resque] if defined?(Resque) && Resque.respond_to?(:logger)
105
+
106
+ # Replace the Sidekiq logger
107
+ Sidekiq::Logging.logger = SemanticLogger[Sidekiq] if defined?(Sidekiq)
97
108
  end
98
109
 
99
110
  end
@@ -1,3 +1,3 @@
1
1
  module RailsSemanticLogger #:nodoc
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.0"
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: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic_logger