logtail-rails 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d238560ec59e0d1b0d936ae0b3b92e11865ba2e80fcc4adeb4d6cb43676c7ae
4
- data.tar.gz: 97e280b2a2c9297a0862dbbd733a4a36e902928b749be07bed9c904243a167f9
3
+ metadata.gz: 97d938a7a8be17f755842dcf6625ea5cef8aee115de0e81a9a8d33722a16d2da
4
+ data.tar.gz: fecfdfab18c9b31582a52987e5271c012707bc7a3cdcb628a261a204a4933c74
5
5
  SHA512:
6
- metadata.gz: bc9b5ab10bb6cb45a9896a1056399c5adb5a8297cc06d7b424bd077884ff3848c6892d526004a2c3dc620ff4b2ce0505fc589be9c0d3b4d60485fd8165b7d5eb
7
- data.tar.gz: 2cbd54fa234e026c71feba8f050e41d6a5b5ae513b806548921943bade86665248a826274d949924b4607a7ce1e72e2fb31137629991ac3cf3c30f59c3d5983c
6
+ metadata.gz: a1f6e1992c6d09df1df6649984d52d655671e4eb7bf031294e9e3eaf2edf7fc0cd5ae403ec42de01440e66fac99c36059b014207e56be0c2d072dd51a544e53a
7
+ data.tar.gz: 63c827e685b29dce41f1c175972ef2eaf2e803ce7fedb771207fc5c3bc07e12c6edd7f9d3e53e32e71b9410d58de43ef3aa68b0d899b1434d1afffb198922995
@@ -2,7 +2,6 @@ name: build
2
2
 
3
3
  on:
4
4
  push:
5
- pull_request:
6
5
  schedule:
7
6
  - cron: '20 5 * * 1'
8
7
  workflow_dispatch:
@@ -16,18 +15,19 @@ jobs:
16
15
 
17
16
  matrix:
18
17
  ruby-version:
19
- - 3.2.2
20
- - 3.1.4
21
- - 3.0.6
22
- - 2.7.2
23
- - 2.6.6
24
- - 2.5.8
18
+ - 3.2
19
+ - 3.1
20
+ - 3.0
21
+ - 2.7
22
+ - 2.6
23
+ - 2.5
25
24
  - jruby-9.4.3.0
26
25
  - jruby-9.2.14.0
27
26
  - truffleruby-23.0.0
28
27
  - truffleruby-22.1.0
29
28
  gemfile:
30
29
  - rails-edge
30
+ - rails-7.1
31
31
  - rails-7.0
32
32
  - rails-6.1
33
33
  - rails-6.0
@@ -36,9 +36,9 @@ jobs:
36
36
  - rails-5.0
37
37
  exclude:
38
38
  - gemfile: rails-edge
39
- ruby-version: 2.6.6
39
+ ruby-version: 2.6
40
40
  - gemfile: rails-edge
41
- ruby-version: 2.5.8
41
+ ruby-version: 2.5
42
42
  - gemfile: rails-edge
43
43
  ruby-version: jruby-9.4.3.0
44
44
  - gemfile: rails-edge
@@ -46,19 +46,28 @@ jobs:
46
46
  - gemfile: rails-edge
47
47
  ruby-version: truffleruby-23.0.0
48
48
 
49
+ - gemfile: rails-7.1
50
+ ruby-version: 2.6
51
+ - gemfile: rails-7.1
52
+ ruby-version: 2.5
53
+ - gemfile: rails-7.1
54
+ ruby-version: jruby-9.4.3.0
55
+ - gemfile: rails-7.1
56
+ ruby-version: jruby-9.2.14.0
57
+
49
58
  - gemfile: rails-7.0
50
- ruby-version: 2.6.6
59
+ ruby-version: 2.6
51
60
  - gemfile: rails-7.0
52
- ruby-version: 2.5.8
61
+ ruby-version: 2.5
53
62
  - gemfile: rails-7.0
54
63
  ruby-version: jruby-9.2.14.0
55
64
 
56
65
  - gemfile: rails-5.2
57
- ruby-version: 3.2.2
66
+ ruby-version: 3.2
58
67
  - gemfile: rails-5.2
59
- ruby-version: 3.1.4
68
+ ruby-version: 3.1
60
69
  - gemfile: rails-5.2
61
- ruby-version: 3.0.6
70
+ ruby-version: 3.0
62
71
  - gemfile: rails-5.2
63
72
  ruby-version: jruby-9.4.3.0
64
73
  - gemfile: rails-5.2
@@ -67,11 +76,11 @@ jobs:
67
76
  ruby-version: truffleruby-23.0.0
68
77
 
69
78
  - gemfile: rails-5.1
70
- ruby-version: 3.2.2
79
+ ruby-version: 3.2
71
80
  - gemfile: rails-5.1
72
- ruby-version: 3.1.4
81
+ ruby-version: 3.1
73
82
  - gemfile: rails-5.1
74
- ruby-version: 3.0.6
83
+ ruby-version: 3.0
75
84
  - gemfile: rails-5.1
76
85
  ruby-version: jruby-9.4.3.0
77
86
  - gemfile: rails-5.1
@@ -80,11 +89,11 @@ jobs:
80
89
  ruby-version: truffleruby-22.1.0
81
90
 
82
91
  - gemfile: rails-5.0
83
- ruby-version: 3.2.2
92
+ ruby-version: 3.2
84
93
  - gemfile: rails-5.0
85
- ruby-version: 3.1.4
94
+ ruby-version: 3.1
86
95
  - gemfile: rails-5.0
87
- ruby-version: 3.0.6
96
+ ruby-version: 3.0
88
97
  - gemfile: rails-5.0
89
98
  ruby-version: jruby-9.4.3.0
90
99
  - gemfile: rails-5.0
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
6
6
  [![Gem Version](https://badge.fury.io/rb/logtail-rails.svg)](https://badge.fury.io/rb/logtail-rails)
7
- [![Build Status](https://github.com/logtail/logtail-ruby-rails/workflows/build/badge.svg)](https://github.com/logtail/logtail-ruby-rails/actions?query=workflow%3Abuild)
7
+ [![Build Status](https://github.com/logtail/logtail-ruby-rails/actions/workflows/main.yml/badge.svg)](https://github.com/logtail/logtail-ruby-rails/actions/workflows/main.yml)
8
8
 
9
9
  Collect logs directly from your Ruby on Rails projects. To start logging Ruby projects explore the [Logtail Ruby library](https://github.com/logtail/logtail-ruby).
10
10
 
@@ -1,10 +1,10 @@
1
1
  source "https://rubygems.org"
2
2
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
3
 
4
- ruby "3.1.2"
4
+ ruby "3.2.2"
5
5
 
6
6
  # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7
- gem "rails", "~> 7.0.6"
7
+ gem "rails", "~> 7.1.0"
8
8
 
9
9
  # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10
10
  gem "sprockets-rails"
@@ -13,7 +13,7 @@ gem "sprockets-rails"
13
13
  gem "sqlite3", "~> 1.4"
14
14
 
15
15
  # Use the Puma web server [https://github.com/puma/puma]
16
- gem "puma", "~> 5.0"
16
+ gem "puma", "~> 6.0"
17
17
 
18
18
  # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
19
19
  gem "importmap-rails"
@@ -71,4 +71,4 @@ group :test do
71
71
  gem "webdrivers"
72
72
  end
73
73
 
74
- gem "logtail-rails", "~> 0.2.0"
74
+ gem "logtail-rails", "~> 0.2.5"
@@ -9,7 +9,7 @@ Bundler.require(*Rails.groups)
9
9
  module ExampleProject
10
10
  class Application < Rails::Application
11
11
  # Initialize configuration defaults for originally generated Rails version.
12
- config.load_defaults 7.0
12
+ config.load_defaults 7.1
13
13
 
14
14
  # Configuration for the application, engines, and railties goes here.
15
15
  #
@@ -19,6 +19,6 @@ module ExampleProject
19
19
  # config.time_zone = "Central Time (US & Canada)"
20
20
  # config.eager_load_paths << Rails.root.join("extras")
21
21
 
22
- config.logger = Logtail::Logger.create_default_logger("<SOURCE_TOKEN>")
22
+ config.logger = Logtail::Logger.create_default_logger("YhLXLk5djXYbxK16moYEhjeu")
23
23
  end
24
24
  end
@@ -6,3 +6,8 @@
6
6
  Rails.application.config.filter_parameters += [
7
7
  :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8
8
  ]
9
+
10
+ # Configure HTTP headers to be filtered from the log. Use this to limit dissemination of sensitive information.
11
+ Logtail::Integrations::Rack::HTTPEvents.http_header_filters = [
12
+ :authorization, :proxy_authorization, :cookie
13
+ ]
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 7.1.0'
4
+
5
+ gem 'logtail'
6
+ gem 'logtail-rack'
7
+
8
+ if RUBY_PLATFORM == "java"
9
+ gem 'mime-types', '2.6.2'
10
+ end
11
+
12
+ gemspec :path => '../'
@@ -16,6 +16,35 @@ module Logtail
16
16
  include ::LoggerSilence
17
17
  end
18
18
 
19
+ # Logtail::Logger also works as ActiveSupport::BroadcastLogger
20
+ def is_a?(clazz)
21
+ return true if clazz == ::ActiveSupport::BroadcastLogger
22
+
23
+ super(clazz)
24
+ end
25
+
26
+ def broadcasts
27
+ [self] + @extra_loggers
28
+ end
29
+
30
+ def broadcast_to(*io_devices_and_loggers)
31
+ io_devices_and_loggers.each do |io_device_or_logger|
32
+ extra_logger = is_a_logger?(io_device_or_logger) ? io_device_or_logger : self.class.new(io_device_or_logger)
33
+
34
+ @extra_loggers << extra_logger
35
+ end
36
+ end
37
+
38
+ def stop_broadcasting_to(io_device_or_logger)
39
+ if is_a_logger?(io_device_or_logger)
40
+ @extra_loggers.delete(logger)
41
+
42
+ return
43
+ end
44
+
45
+ @extra_loggers = @extra_loggers.reject { |logger| ::ActiveSupport::Logger.logger_outputs_to?(logger, io_device_or_logger) }
46
+ end
47
+
19
48
  def self.create_logger(*io_devices_and_loggers)
20
49
  logger = Logtail::Logger.new(*io_devices_and_loggers)
21
50
 
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rails
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtail-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Better Stack
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-04 00:00:00.000000000 Z
11
+ date: 2023-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logtail
@@ -266,7 +266,7 @@ files:
266
266
  - example-project/config/importmap.rb
267
267
  - example-project/config/initializers/assets.rb
268
268
  - example-project/config/initializers/content_security_policy.rb
269
- - example-project/config/initializers/filter_parameter_logging.rb
269
+ - example-project/config/initializers/filter_logging.rb
270
270
  - example-project/config/initializers/inflections.rb
271
271
  - example-project/config/initializers/permissions_policy.rb
272
272
  - example-project/config/locales/en.yml
@@ -306,6 +306,7 @@ files:
306
306
  - gemfiles/rails-6.0.gemfile
307
307
  - gemfiles/rails-6.1.gemfile
308
308
  - gemfiles/rails-7.0.gemfile
309
+ - gemfiles/rails-7.1.gemfile
309
310
  - gemfiles/rails-edge.gemfile
310
311
  - lib/logtail-rails.rb
311
312
  - lib/logtail-rails/action_controller.rb
@@ -360,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
360
361
  - !ruby/object:Gem::Version
361
362
  version: '0'
362
363
  requirements: []
363
- rubygems_version: 3.4.10
364
+ rubygems_version: 3.3.7
364
365
  signing_key:
365
366
  specification_version: 4
366
367
  summary: Better Stack Rails integration