logstasher-plugin-delayed 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 152fe753ccd69392ee4e6e7326ab43e7aac29157
4
+ data.tar.gz: 5527c4e5416c9549caef16820e51740e0866feb0
5
+ SHA512:
6
+ metadata.gz: b19b259bb2115d0138b5743361f17130f7b1df480305b0b90db09823e63ecbe0786c2082c5382a5e6bdc2caa07fd1debadee53a98c0434d1b571db20dae91097
7
+ data.tar.gz: 77cbbf8c0af193539f270243580a86209dbeb9fae9d79649ee92136f507287267140e05a9f47c0e260bc988125808c31b5f8a6521dd253e590a014f96d913b6c
@@ -0,0 +1,20 @@
1
+ require 'logstasher'
2
+ require 'delayed_job'
3
+
4
+ module LogStasher
5
+ module Plugin
6
+ module Delayed
7
+ class Plugin < ::Delayed::Plugin
8
+ callbacks do |lifecycle|
9
+ lifecycle.before(:invoke_job) do |job, *args, &block|
10
+ ::LogStasher.request_context[:request_id] = job.id
11
+ # perhaps handler#object.first_line and method_name would be interesting too (in store??)
12
+ end
13
+ lifecycle.after(:invoke_job) do |job, *args, &block|
14
+ ::LogStasher.request_context[:request_id] = nil
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ require 'rails/railtie'
2
+
3
+ module LogStasher
4
+ module Plugin
5
+ module Delayed
6
+ class Railtie < Rails::Railtie
7
+ config.logstasher_plugin_delayed = ::ActiveSupport::OrderedOptions.new
8
+ config.logstasher_plugin_delayed.enabled = false
9
+
10
+ initializer :logstasher_plugin_delayed do
11
+ config.after_initialize do
12
+ LogStasher::Plugin::Delayed.setup(config.logstasher_plugin_delayed) if config.logstasher_plugin_delayed.enabled
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ module LogStasher
2
+ module Plugin
3
+ module Delayed
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logstasher-plugin-delayed
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Marc Grimme
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logstasher
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: delayed_job
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 4.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 4.0.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '2.14'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '2.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ description: Awesome rails logs supports delayed jobs
84
+ email:
85
+ - marc.grimme@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - lib/logstasher/plugin/delayed/plugin.rb
91
+ - lib/logstasher/plugin/delayed/railtie.rb
92
+ - lib/logstasher/plugin/delayed/version.rb
93
+ homepage: https://github.com/marcgrimme/logstasher-plugin-delayed
94
+ licenses:
95
+ - MIT
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.4.5
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Awesome rails logs supports delayed jobs
117
+ test_files: []