logjam_agent 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logjam_agent/rack/logger.rb +59 -16
- data/lib/logjam_agent/version.rb +1 -1
- metadata +4 -4
@@ -121,22 +121,65 @@ require 'action_controller/log_subscriber'
|
|
121
121
|
module ActionController #:nodoc:
|
122
122
|
|
123
123
|
class LogSubscriber
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
124
|
+
if Rails::VERSION::STRING =~ /^3.0/
|
125
|
+
def start_processing(event)
|
126
|
+
payload = event.payload
|
127
|
+
params = payload[:params].except(*INTERNAL_PARAMS)
|
128
|
+
|
129
|
+
controller = payload[:controller]
|
130
|
+
action = payload[:action]
|
131
|
+
full_name = "#{controller}##{action}"
|
132
|
+
action_name = LogjamAgent.action_name_proc.call(full_name)
|
133
|
+
|
134
|
+
# puts "setting logjam action to #{action_name}"
|
135
|
+
Rails.logger.request.fields[:action] = action_name
|
136
|
+
|
137
|
+
info " Processing by #{full_name} as #{payload[:formats].first.to_s.upcase}"
|
138
|
+
info " Parameters: #{params.inspect}" unless params.empty?
|
139
|
+
end
|
140
|
+
|
141
|
+
elsif Rails::VERSION::STRING =~ /^3.1/
|
142
|
+
|
143
|
+
def start_processing(event)
|
144
|
+
payload = event.payload
|
145
|
+
params = payload[:params].except(*INTERNAL_PARAMS)
|
146
|
+
format = payload[:format]
|
147
|
+
format = format.to_s.upcase if format.is_a?(Symbol)
|
148
|
+
|
149
|
+
controller = payload[:controller]
|
150
|
+
action = payload[:action]
|
151
|
+
full_name = "#{controller}##{action}"
|
152
|
+
action_name = LogjamAgent.action_name_proc.call(full_name)
|
153
|
+
|
154
|
+
# puts "setting logjam action to #{action_name}"
|
155
|
+
Rails.logger.request.fields[:action] = action_name
|
156
|
+
|
157
|
+
info " Processing by #{full_name} as #{format}"
|
158
|
+
info " Parameters: #{params.inspect}" unless params.empty?
|
159
|
+
end
|
160
|
+
|
161
|
+
elsif Rails::VERSION::STRING =~ /^3.2/
|
162
|
+
|
163
|
+
def start_processing(event)
|
164
|
+
payload = event.payload
|
165
|
+
params = payload[:params].except(*INTERNAL_PARAMS)
|
166
|
+
format = payload[:format]
|
167
|
+
format = format.to_s.upcase if format.is_a?(Symbol)
|
168
|
+
|
169
|
+
controller = payload[:controller]
|
170
|
+
action = payload[:action]
|
171
|
+
full_name = "#{controller}##{action}"
|
172
|
+
action_name = LogjamAgent.action_name_proc.call(full_name)
|
173
|
+
|
174
|
+
# puts "setting logjam action to #{action_name}"
|
175
|
+
Rails.logger.request.fields[:action] = action_name
|
176
|
+
|
177
|
+
info "Processing by #{full_name} as #{format}"
|
178
|
+
info " Parameters: #{params.inspect}" unless params.empty?
|
179
|
+
end
|
180
|
+
|
181
|
+
else
|
182
|
+
raise "loggjam_agent ActionController monkey patch is not compatible with your Rails version"
|
140
183
|
end
|
141
184
|
end
|
142
185
|
|
data/lib/logjam_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 8
|
10
|
+
version: 0.6.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stefan Kaes
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-05-
|
18
|
+
date: 2013-05-17 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|