loggery 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/.travis.yml +4 -7
- data/Appraisals +4 -12
- data/Changes.md +6 -0
- data/README.md +4 -4
- data/gemfiles/rails5.2.gemfile +1 -1
- data/gemfiles/{rails4.2.gemfile → rails6.0.gemfile} +1 -1
- data/lib/loggery/gem/version.rb +1 -1
- data/lib/loggery/metadata/middleware/sidekiq.rb +6 -8
- data/lib/loggery/sidekiq/setup.rb +2 -2
- metadata +5 -6
- data/gemfiles/rails5.0.gemfile +0 -7
- data/gemfiles/rails5.1.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b3f02b4ee50f2e942444925c0278c5f18e9cfdc0e38594102570055a4d6ddf75
|
4
|
+
data.tar.gz: '0733840f78c3d3bc32a2e6cb5c5cf8109716bdd608793978b6f67a2cef0c4c57'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d87cca82b3c6ee57708e31f58abb608378e136537d71f945650d5fcd2ab289f1e469f8fedbedf39941f9b08b5408dbe8aab8db9923704771f928cf5bc2bb7a9b
|
7
|
+
data.tar.gz: 72d8d29e17a52316df6b1059eeddea1fb39b0236beacc60917e5a8416b524c809ec690be95857f4643a29bddca09578884717262b3f51cc4fefdfe4b0f2337cf
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
- 2.
|
4
|
+
- 2.5.6
|
5
|
+
- 2.6.4
|
5
6
|
gemfile:
|
6
|
-
- gemfiles/rails4.2.gemfile
|
7
|
-
- gemfiles/rails5.0.gemfile
|
8
|
-
- gemfiles/rails5.1.gemfile
|
9
7
|
- gemfiles/rails5.2.gemfile
|
8
|
+
- gemfiles/rails6.0.gemfile
|
10
9
|
before_install:
|
11
10
|
- rvm use @global
|
12
|
-
|
13
|
-
- gem install -v 1.17.2 bundler --no-rdoc --no-ri
|
14
|
-
script:
|
11
|
+
script:
|
15
12
|
- bundle exec rubocop
|
16
13
|
- bundle exec rspec
|
data/Appraisals
CHANGED
@@ -1,17 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise "
|
4
|
-
gem "rails", "~>
|
5
|
-
end
|
6
|
-
|
7
|
-
appraise "rails5.0" do
|
8
|
-
gem "rails", "~> 5.0.0"
|
9
|
-
end
|
10
|
-
|
11
|
-
appraise "rails5.1" do
|
12
|
-
gem "rails", "~> 5.1.0"
|
3
|
+
appraise "rails5.2" do
|
4
|
+
gem "rails", "~>5.2.0"
|
13
5
|
end
|
14
6
|
|
15
|
-
appraise "
|
16
|
-
gem "rails", "
|
7
|
+
appraise "rails6.0" do
|
8
|
+
gem "rails", "~>6.0.0"
|
17
9
|
end
|
data/Changes.md
ADDED
data/README.md
CHANGED
@@ -25,7 +25,7 @@ And then execute:
|
|
25
25
|
|
26
26
|
### Basic Rails integration
|
27
27
|
|
28
|
-
To enable, add
|
28
|
+
To enable, add
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
config.loggery.enabled = true
|
@@ -85,8 +85,8 @@ your `ApplicationController`:
|
|
85
85
|
include Loggery::Controller::LoggingContext
|
86
86
|
|
87
87
|
def loggery_log_context
|
88
|
-
{
|
89
|
-
user_id: current_user&.id,
|
88
|
+
{
|
89
|
+
user_id: current_user&.id,
|
90
90
|
user_email: current_user&.email
|
91
91
|
}
|
92
92
|
end
|
@@ -98,7 +98,7 @@ would like to add to your log records.
|
|
98
98
|
|
99
99
|
### Sidekiq
|
100
100
|
|
101
|
-
If you're using Sidekiq you can enable structured logging in sidekiq by adding these lines to
|
101
|
+
If you're using Sidekiq you can enable structured logging in sidekiq by adding these lines to
|
102
102
|
`config/initializers/sidekiq.rb`:
|
103
103
|
|
104
104
|
```ruby
|
data/gemfiles/rails5.2.gemfile
CHANGED
data/lib/loggery/gem/version.rb
CHANGED
@@ -19,14 +19,12 @@ module Loggery
|
|
19
19
|
log_job_start(message, job_instance_name)
|
20
20
|
|
21
21
|
log_job_runtime(:sidekiq_job, job_instance_name) do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
raise e
|
29
|
-
end
|
22
|
+
yield
|
23
|
+
rescue StandardError => e
|
24
|
+
# Log exceptions here, otherwise they won't have the metadata available anymore by
|
25
|
+
# the time they reach the Sidekiq default error handler.
|
26
|
+
self.class.error_handler&.call(e)
|
27
|
+
raise e
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
@@ -4,9 +4,9 @@ module Loggery
|
|
4
4
|
module Sidekiq
|
5
5
|
module Setup
|
6
6
|
def self.setup
|
7
|
-
::Sidekiq::Logging.logger = Rails.logger
|
8
|
-
|
9
7
|
::Sidekiq.configure_server do |config|
|
8
|
+
config.logger = Rails.logger
|
9
|
+
|
10
10
|
config.server_middleware do |chain|
|
11
11
|
chain.add Loggery::Metadata::Middleware::Sidekiq
|
12
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loggery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Stemplinger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -233,15 +233,14 @@ files:
|
|
233
233
|
- ".travis.yml"
|
234
234
|
- Appraisals
|
235
235
|
- CODE_OF_CONDUCT.md
|
236
|
+
- Changes.md
|
236
237
|
- Gemfile
|
237
238
|
- LICENSE.txt
|
238
239
|
- README.md
|
239
240
|
- Rakefile
|
240
241
|
- gemfiles/.bundle/config
|
241
|
-
- gemfiles/rails4.2.gemfile
|
242
|
-
- gemfiles/rails5.0.gemfile
|
243
|
-
- gemfiles/rails5.1.gemfile
|
244
242
|
- gemfiles/rails5.2.gemfile
|
243
|
+
- gemfiles/rails6.0.gemfile
|
245
244
|
- lib/loggery.rb
|
246
245
|
- lib/loggery/controller/logging_context.rb
|
247
246
|
- lib/loggery/gem/version.rb
|
@@ -274,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
274
273
|
version: '0'
|
275
274
|
requirements: []
|
276
275
|
rubyforge_project:
|
277
|
-
rubygems_version: 2.
|
276
|
+
rubygems_version: 2.7.6
|
278
277
|
signing_key:
|
279
278
|
specification_version: 4
|
280
279
|
summary: Generate logstash compatible log output from Rails apps.
|
data/gemfiles/rails5.0.gemfile
DELETED