rails-logstasher 0.1.1 → 0.1.2
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 +8 -8
- data/README.md +3 -0
- data/lib/rails-logstasher/tagged_logging.rb +11 -1
- data/lib/rails-logstasher/version.rb +1 -1
- data/lib/rails-logstasher.rb +9 -0
- metadata +94 -94
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTdlYWFhNTYwOWQxODFiOTRkNGIzNDIwZDU3NzkxOWRmMjQ5YzJiOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2M0NTlmMDNjYzAyZGI4YzZhMWFmZGM2ODc5MzJhMGM3ZTljM2M2Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2RkZDlmYTNiYjVkYjA3ODhlYWNjMzdkNzgwZTk2MTQzOTM3MjI1Njk3Nzg3
|
10
|
+
N2UyNjYzYmVhOTZmYWQwM2RiMjFlZGUyMTBiNGQ3ZmFmZTllMGQ0MzgzMjAx
|
11
|
+
ODhkY2MzMjQ3MGVmYjhkYzliNDg4NzMzZDBiM2NmZmJmZDIyZWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTI3NDk1OWExMjI5NzcwNTY4OWMxYjFmMGRmMWM5N2IxYjQ3OTAzODMzZTE0
|
14
|
+
NDQ2MzNiZjFiMzMzYjBiOGIyMmE3NjYwMmIyYTY2ODI5MjM1Y2Y4ZGE1NTVj
|
15
|
+
MDFmY2JlOTMyOGJhY2Q0MDFhYWY4NzcwZjg4ODZlN2MwNmYwOWI=
|
data/README.md
CHANGED
@@ -46,6 +46,9 @@ module MyApp
|
|
46
46
|
# Set a logger compatible with the standard ruby logger to be used by RailsLogstasher
|
47
47
|
config.logger = RailsLogstasher::Logger.new(Rails.root.join('log',"#{Rails.env}.log").to_s)
|
48
48
|
|
49
|
+
# Optionally process log entries before they are written to the log
|
50
|
+
RailsLogstasher.config[:entry_processor] = Proc.new {|entry| ... do stuff with entry...}
|
51
|
+
|
49
52
|
end
|
50
53
|
end
|
51
54
|
```
|
@@ -30,10 +30,20 @@ module RailsLogstasher
|
|
30
30
|
@entry.type = @log_type
|
31
31
|
process_tags(current_tags)
|
32
32
|
process_tags(current_request_tags)
|
33
|
+
|
34
|
+
process_entry
|
35
|
+
|
33
36
|
#TODO Should we do anything with progname? What about source?
|
34
37
|
super(severity, timestamp, progname, @entry.to_json)
|
35
38
|
end
|
36
39
|
|
40
|
+
def process_entry
|
41
|
+
entry_processor = RailsLogstasher.config[:entry_processor]
|
42
|
+
return unless entry_processor && entry_processor.class == Proc
|
43
|
+
|
44
|
+
entry_processor.call @entry
|
45
|
+
end
|
46
|
+
|
37
47
|
def tagged(*tags)
|
38
48
|
new_tags = push_tags(*tags)
|
39
49
|
yield self
|
@@ -94,7 +104,7 @@ module RailsLogstasher
|
|
94
104
|
logger.extend(self)
|
95
105
|
end
|
96
106
|
|
97
|
-
delegate :push_tags, :push_request_tags, :pop_tags, :clear_tags!, :log_type=, to
|
107
|
+
delegate :push_tags, :push_request_tags, :pop_tags, :clear_tags!, :log_type=, :to => :formatter
|
98
108
|
|
99
109
|
def tagged(*tags)
|
100
110
|
formatter.tagged(*tags) { yield self }
|
data/lib/rails-logstasher.rb
CHANGED
@@ -13,4 +13,13 @@ module RailsLogstasher
|
|
13
13
|
@@events ||= {}
|
14
14
|
end
|
15
15
|
|
16
|
+
# Options:
|
17
|
+
# :entry_processor - a Proc to custom handle entries right before they are written to the log.
|
18
|
+
# RailsLogstasher.config[:entry_processor] = Proc.new {|entry| ... do stuff with entry ...}
|
19
|
+
#
|
20
|
+
def self.config
|
21
|
+
@@config ||= {}
|
22
|
+
end
|
23
|
+
|
24
|
+
|
16
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-logstasher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nadav Fischer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -60,80 +60,80 @@ executables: []
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- lib/rails-logstasher.rb
|
64
|
-
- lib/rails-logstasher/
|
65
|
-
- lib/rails-logstasher/
|
66
|
-
- lib/rails-logstasher/version.rb
|
63
|
+
- lib/rails-logstasher/action_controller/log_subscriber.rb
|
64
|
+
- lib/rails-logstasher/action_view/log_subscriber.rb
|
65
|
+
- lib/rails-logstasher/active_record/log_subscriber.rb
|
67
66
|
- lib/rails-logstasher/active_resource/log_subscriber.rb
|
67
|
+
- lib/rails-logstasher/core_ext/object/blank.rb
|
68
|
+
- lib/rails-logstasher/event.rb
|
69
|
+
- lib/rails-logstasher/logger.rb
|
68
70
|
- lib/rails-logstasher/rack/logger.rb
|
69
71
|
- lib/rails-logstasher/railtie.rb
|
70
|
-
- lib/rails-logstasher/logger.rb
|
71
|
-
- lib/rails-logstasher/action_view/log_subscriber.rb
|
72
72
|
- lib/rails-logstasher/tagged_logging.rb
|
73
|
-
- lib/rails-logstasher/
|
74
|
-
- lib/rails-logstasher
|
73
|
+
- lib/rails-logstasher/version.rb
|
74
|
+
- lib/rails-logstasher.rb
|
75
75
|
- MIT-LICENSE
|
76
76
|
- Rakefile
|
77
77
|
- README.md
|
78
|
-
- test/support/integration_case.rb
|
79
|
-
- test/support/fake_models.rb
|
80
|
-
- test/support/multibyte_test_helpers.rb
|
81
|
-
- test/test_helper.rb
|
82
|
-
- test/core_ext/blank_test.rb
|
83
|
-
- test/tagged_logging_test.rb
|
84
|
-
- test/logger_test.rb
|
85
|
-
- test/active_resource/log_subscriber_test.rb
|
86
|
-
- test/rack/logger_test.rb
|
87
|
-
- test/action_view/log_subscriber_test.rb
|
88
78
|
- test/action_controller/log_subscriber_test.rb
|
89
|
-
- test/
|
90
|
-
- test/
|
91
|
-
- test/
|
92
|
-
- test/
|
79
|
+
- test/action_view/log_subscriber_test.rb
|
80
|
+
- test/active_record/log_subscriber_test.rb
|
81
|
+
- test/active_resource/log_subscriber_test.rb
|
82
|
+
- test/core_ext/blank_test.rb
|
93
83
|
- test/dummy/app/assets/javascripts/application.js
|
94
84
|
- test/dummy/app/assets/javascripts/widgets.js
|
85
|
+
- test/dummy/app/assets/stylesheets/application.css
|
95
86
|
- test/dummy/app/assets/stylesheets/scaffold.css
|
96
87
|
- test/dummy/app/assets/stylesheets/widgets.css
|
97
|
-
- test/dummy/app/
|
88
|
+
- test/dummy/app/controllers/application_controller.rb
|
89
|
+
- test/dummy/app/controllers/log_subscriber_controller.rb
|
90
|
+
- test/dummy/app/controllers/widgets_controller.rb
|
98
91
|
- test/dummy/app/helpers/application_helper.rb
|
99
92
|
- test/dummy/app/helpers/widgets_helper.rb
|
100
|
-
- test/dummy/app/controllers/widgets_controller.rb
|
101
|
-
- test/dummy/app/controllers/log_subscriber_controller.rb
|
102
|
-
- test/dummy/app/controllers/application_controller.rb
|
103
93
|
- test/dummy/app/models/widget.rb
|
104
|
-
- test/dummy/app/views/
|
105
|
-
- test/dummy/app/views/widgets/show.html.erb
|
106
|
-
- test/dummy/app/views/widgets/edit.html.erb
|
107
|
-
- test/dummy/app/views/widgets/index.html.erb
|
108
|
-
- test/dummy/app/views/widgets/_form.html.erb
|
94
|
+
- test/dummy/app/views/customers/_customer.html.erb
|
109
95
|
- test/dummy/app/views/good_customers/_good_customer.html.erb
|
96
|
+
- test/dummy/app/views/layouts/application.html.erb
|
110
97
|
- test/dummy/app/views/test/_customer.erb
|
111
98
|
- test/dummy/app/views/test/hello_world.erb
|
112
|
-
- test/dummy/app/views/
|
113
|
-
- test/dummy/app/views/
|
114
|
-
- test/dummy/
|
115
|
-
- test/dummy/
|
116
|
-
- test/dummy/
|
117
|
-
- test/dummy/
|
118
|
-
- test/dummy/
|
119
|
-
- test/dummy/public/favicon.ico
|
120
|
-
- test/dummy/script/rails
|
99
|
+
- test/dummy/app/views/widgets/_form.html.erb
|
100
|
+
- test/dummy/app/views/widgets/edit.html.erb
|
101
|
+
- test/dummy/app/views/widgets/index.html.erb
|
102
|
+
- test/dummy/app/views/widgets/new.html.erb
|
103
|
+
- test/dummy/app/views/widgets/show.html.erb
|
104
|
+
- test/dummy/config/application.rb
|
105
|
+
- test/dummy/config/boot.rb
|
121
106
|
- test/dummy/config/database.yml
|
122
107
|
- test/dummy/config/environment.rb
|
123
|
-
- test/dummy/config/
|
124
|
-
- test/dummy/config/
|
108
|
+
- test/dummy/config/environments/development.rb
|
109
|
+
- test/dummy/config/environments/production.rb
|
110
|
+
- test/dummy/config/environments/test.rb
|
111
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
112
|
+
- test/dummy/config/initializers/inflections.rb
|
125
113
|
- test/dummy/config/initializers/mime_types.rb
|
126
114
|
- test/dummy/config/initializers/secret_token.rb
|
127
115
|
- test/dummy/config/initializers/session_store.rb
|
128
|
-
- test/dummy/config/initializers/
|
129
|
-
- test/dummy/config/initializers/inflections.rb
|
130
|
-
- test/dummy/config/environments/production.rb
|
131
|
-
- test/dummy/config/environments/test.rb
|
132
|
-
- test/dummy/config/environments/development.rb
|
133
|
-
- test/dummy/config/boot.rb
|
134
|
-
- test/dummy/config/routes.rb
|
116
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
135
117
|
- test/dummy/config/locales/en.yml
|
136
|
-
- test/
|
118
|
+
- test/dummy/config/routes.rb
|
119
|
+
- test/dummy/config.ru
|
120
|
+
- test/dummy/db/migrate/20120927084605_create_widgets.rb
|
121
|
+
- test/dummy/db/schema.rb
|
122
|
+
- test/dummy/public/404.html
|
123
|
+
- test/dummy/public/422.html
|
124
|
+
- test/dummy/public/500.html
|
125
|
+
- test/dummy/public/favicon.ico
|
126
|
+
- test/dummy/Rakefile
|
127
|
+
- test/dummy/README.rdoc
|
128
|
+
- test/dummy/script/rails
|
129
|
+
- test/logger_test.rb
|
130
|
+
- test/rack/logger_test.rb
|
131
|
+
- test/rails_logstasher_test.rb
|
132
|
+
- test/support/fake_models.rb
|
133
|
+
- test/support/integration_case.rb
|
134
|
+
- test/support/multibyte_test_helpers.rb
|
135
|
+
- test/tagged_logging_test.rb
|
136
|
+
- test/test_helper.rb
|
137
137
|
homepage: https://github.com/capriza/rails-logstasher
|
138
138
|
licenses: []
|
139
139
|
metadata: {}
|
@@ -158,62 +158,62 @@ signing_key:
|
|
158
158
|
specification_version: 4
|
159
159
|
summary: Lostash format replacement for Ruby on Rails logging system
|
160
160
|
test_files:
|
161
|
-
- test/support/integration_case.rb
|
162
|
-
- test/support/fake_models.rb
|
163
|
-
- test/support/multibyte_test_helpers.rb
|
164
|
-
- test/test_helper.rb
|
165
|
-
- test/core_ext/blank_test.rb
|
166
|
-
- test/tagged_logging_test.rb
|
167
|
-
- test/logger_test.rb
|
168
|
-
- test/active_resource/log_subscriber_test.rb
|
169
|
-
- test/rack/logger_test.rb
|
170
|
-
- test/action_view/log_subscriber_test.rb
|
171
161
|
- test/action_controller/log_subscriber_test.rb
|
172
|
-
- test/
|
173
|
-
- test/
|
174
|
-
- test/
|
175
|
-
- test/
|
162
|
+
- test/action_view/log_subscriber_test.rb
|
163
|
+
- test/active_record/log_subscriber_test.rb
|
164
|
+
- test/active_resource/log_subscriber_test.rb
|
165
|
+
- test/core_ext/blank_test.rb
|
176
166
|
- test/dummy/app/assets/javascripts/application.js
|
177
167
|
- test/dummy/app/assets/javascripts/widgets.js
|
168
|
+
- test/dummy/app/assets/stylesheets/application.css
|
178
169
|
- test/dummy/app/assets/stylesheets/scaffold.css
|
179
170
|
- test/dummy/app/assets/stylesheets/widgets.css
|
180
|
-
- test/dummy/app/
|
171
|
+
- test/dummy/app/controllers/application_controller.rb
|
172
|
+
- test/dummy/app/controllers/log_subscriber_controller.rb
|
173
|
+
- test/dummy/app/controllers/widgets_controller.rb
|
181
174
|
- test/dummy/app/helpers/application_helper.rb
|
182
175
|
- test/dummy/app/helpers/widgets_helper.rb
|
183
|
-
- test/dummy/app/controllers/widgets_controller.rb
|
184
|
-
- test/dummy/app/controllers/log_subscriber_controller.rb
|
185
|
-
- test/dummy/app/controllers/application_controller.rb
|
186
176
|
- test/dummy/app/models/widget.rb
|
187
|
-
- test/dummy/app/views/
|
188
|
-
- test/dummy/app/views/widgets/show.html.erb
|
189
|
-
- test/dummy/app/views/widgets/edit.html.erb
|
190
|
-
- test/dummy/app/views/widgets/index.html.erb
|
191
|
-
- test/dummy/app/views/widgets/_form.html.erb
|
177
|
+
- test/dummy/app/views/customers/_customer.html.erb
|
192
178
|
- test/dummy/app/views/good_customers/_good_customer.html.erb
|
179
|
+
- test/dummy/app/views/layouts/application.html.erb
|
193
180
|
- test/dummy/app/views/test/_customer.erb
|
194
181
|
- test/dummy/app/views/test/hello_world.erb
|
195
|
-
- test/dummy/app/views/
|
196
|
-
- test/dummy/app/views/
|
197
|
-
- test/dummy/
|
198
|
-
- test/dummy/
|
199
|
-
- test/dummy/
|
200
|
-
- test/dummy/
|
201
|
-
- test/dummy/
|
202
|
-
- test/dummy/public/favicon.ico
|
203
|
-
- test/dummy/script/rails
|
182
|
+
- test/dummy/app/views/widgets/_form.html.erb
|
183
|
+
- test/dummy/app/views/widgets/edit.html.erb
|
184
|
+
- test/dummy/app/views/widgets/index.html.erb
|
185
|
+
- test/dummy/app/views/widgets/new.html.erb
|
186
|
+
- test/dummy/app/views/widgets/show.html.erb
|
187
|
+
- test/dummy/config/application.rb
|
188
|
+
- test/dummy/config/boot.rb
|
204
189
|
- test/dummy/config/database.yml
|
205
190
|
- test/dummy/config/environment.rb
|
206
|
-
- test/dummy/config/
|
207
|
-
- test/dummy/config/
|
191
|
+
- test/dummy/config/environments/development.rb
|
192
|
+
- test/dummy/config/environments/production.rb
|
193
|
+
- test/dummy/config/environments/test.rb
|
194
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
195
|
+
- test/dummy/config/initializers/inflections.rb
|
208
196
|
- test/dummy/config/initializers/mime_types.rb
|
209
197
|
- test/dummy/config/initializers/secret_token.rb
|
210
198
|
- test/dummy/config/initializers/session_store.rb
|
211
|
-
- test/dummy/config/initializers/
|
212
|
-
- test/dummy/config/initializers/inflections.rb
|
213
|
-
- test/dummy/config/environments/production.rb
|
214
|
-
- test/dummy/config/environments/test.rb
|
215
|
-
- test/dummy/config/environments/development.rb
|
216
|
-
- test/dummy/config/boot.rb
|
217
|
-
- test/dummy/config/routes.rb
|
199
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
218
200
|
- test/dummy/config/locales/en.yml
|
219
|
-
- test/
|
201
|
+
- test/dummy/config/routes.rb
|
202
|
+
- test/dummy/config.ru
|
203
|
+
- test/dummy/db/migrate/20120927084605_create_widgets.rb
|
204
|
+
- test/dummy/db/schema.rb
|
205
|
+
- test/dummy/public/404.html
|
206
|
+
- test/dummy/public/422.html
|
207
|
+
- test/dummy/public/500.html
|
208
|
+
- test/dummy/public/favicon.ico
|
209
|
+
- test/dummy/Rakefile
|
210
|
+
- test/dummy/README.rdoc
|
211
|
+
- test/dummy/script/rails
|
212
|
+
- test/logger_test.rb
|
213
|
+
- test/rack/logger_test.rb
|
214
|
+
- test/rails_logstasher_test.rb
|
215
|
+
- test/support/fake_models.rb
|
216
|
+
- test/support/integration_case.rb
|
217
|
+
- test/support/multibyte_test_helpers.rb
|
218
|
+
- test/tagged_logging_test.rb
|
219
|
+
- test/test_helper.rb
|