logtail-rails 0.3.0 → 0.3.1
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 +4 -4
- data/.github/actions/cleanup-sources/action.yml +33 -0
- data/.github/actions/cleanup-sources/run.sh +51 -0
- data/.github/actions/create-source/action.yml +46 -0
- data/.github/actions/create-source/run.sh +40 -0
- data/.github/actions/verify-logs/action.yml +47 -0
- data/.github/actions/verify-logs/run.sh +104 -0
- data/.github/workflows/e2e.yml +275 -0
- data/.github/workflows/main.yml +6 -20
- data/.github/workflows/notify_linear_failure.yml +153 -0
- data/e2e/example.sh +66 -0
- data/e2e/expected.json +109 -0
- data/e2e/installed.rb +20 -0
- data/e2e/plan.sh +112 -0
- data/example-project/Gemfile +2 -4
- data/example-project/README.md +9 -7
- data/example-project/app/controllers/example_controller.rb +14 -7
- data/example-project/app/views/example/index.html.erb +3 -1
- data/example-project/config/application.rb +5 -4
- data/example-project/config/routes.rb +1 -0
- data/lib/logtail-rails/version.rb +1 -1
- data/lib/logtail-rails.rb +4 -0
- metadata +13 -2
- data/gemfiles/rails-edge.gemfile +0 -13
|
@@ -8,8 +8,8 @@ Bundler.require(*Rails.groups)
|
|
|
8
8
|
|
|
9
9
|
module ExampleProject
|
|
10
10
|
class Application < Rails::Application
|
|
11
|
-
# Initialize configuration defaults
|
|
12
|
-
config.load_defaults
|
|
11
|
+
# Initialize configuration defaults of Rails 7.1, the oldest Rails this example runs on.
|
|
12
|
+
config.load_defaults 7.1
|
|
13
13
|
|
|
14
14
|
# Configuration for the application, engines, and railties goes here.
|
|
15
15
|
#
|
|
@@ -19,9 +19,10 @@ module ExampleProject
|
|
|
19
19
|
# config.time_zone = "Central Time (US & Canada)"
|
|
20
20
|
# config.eager_load_paths << Rails.root.join("extras")
|
|
21
21
|
|
|
22
|
+
# Send the logs to your Better Stack source, its token and ingesting host are read from the environment
|
|
22
23
|
config.logger = Logtail::Logger.create_default_logger(
|
|
23
|
-
"
|
|
24
|
-
ingesting_host: "
|
|
24
|
+
ENV["BETTER_STACK_SOURCE_TOKEN"],
|
|
25
|
+
ingesting_host: ENV["BETTER_STACK_INGESTING_HOST"],
|
|
25
26
|
)
|
|
26
27
|
end
|
|
27
28
|
end
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Rails.application.routes.draw do
|
|
2
2
|
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
|
3
3
|
get '/send_logs', to: 'example#send_logs', as: 'send_logs'
|
|
4
|
+
get '/raise_error', to: 'example#raise_error', as: 'raise_error'
|
|
4
5
|
|
|
5
6
|
# Defines the root path route ("/")
|
|
6
7
|
root 'example#index'
|
data/lib/logtail-rails.rb
CHANGED
|
@@ -2,6 +2,10 @@ require "logtail-rails/overrides"
|
|
|
2
2
|
|
|
3
3
|
require "logtail"
|
|
4
4
|
|
|
5
|
+
# Rails' own files rely on Active Support being loaded first, and on Rails main (8.2.0.alpha) rails/railtie
|
|
6
|
+
# fails without it: "uninitialized constant ActiveSupport::DescendantsTracker::WeakSet". It comes after logtail,
|
|
7
|
+
# which loads Ruby's logger: older Active Support releases need that with concurrent-ruby 1.3.5 or newer.
|
|
8
|
+
require "active_support"
|
|
5
9
|
require "rails/railtie"
|
|
6
10
|
require "active_record"
|
|
7
11
|
require "rack"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logtail-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Better Stack
|
|
@@ -237,8 +237,16 @@ executables: []
|
|
|
237
237
|
extensions: []
|
|
238
238
|
extra_rdoc_files: []
|
|
239
239
|
files:
|
|
240
|
+
- ".github/actions/cleanup-sources/action.yml"
|
|
241
|
+
- ".github/actions/cleanup-sources/run.sh"
|
|
242
|
+
- ".github/actions/create-source/action.yml"
|
|
243
|
+
- ".github/actions/create-source/run.sh"
|
|
244
|
+
- ".github/actions/verify-logs/action.yml"
|
|
245
|
+
- ".github/actions/verify-logs/run.sh"
|
|
246
|
+
- ".github/workflows/e2e.yml"
|
|
240
247
|
- ".github/workflows/main.yml"
|
|
241
248
|
- ".github/workflows/no-closing-keywords.yml"
|
|
249
|
+
- ".github/workflows/notify_linear_failure.yml"
|
|
242
250
|
- ".github/workflows/release.yml"
|
|
243
251
|
- ".gitignore"
|
|
244
252
|
- ".rspec"
|
|
@@ -246,6 +254,10 @@ files:
|
|
|
246
254
|
- LICENSE.md
|
|
247
255
|
- README.md
|
|
248
256
|
- Rakefile
|
|
257
|
+
- e2e/example.sh
|
|
258
|
+
- e2e/expected.json
|
|
259
|
+
- e2e/installed.rb
|
|
260
|
+
- e2e/plan.sh
|
|
249
261
|
- example-project/.gitattributes
|
|
250
262
|
- example-project/.gitignore
|
|
251
263
|
- example-project/Gemfile
|
|
@@ -336,7 +348,6 @@ files:
|
|
|
336
348
|
- gemfiles/rails-7.2.gemfile
|
|
337
349
|
- gemfiles/rails-8.0.gemfile
|
|
338
350
|
- gemfiles/rails-8.1.gemfile
|
|
339
|
-
- gemfiles/rails-edge.gemfile
|
|
340
351
|
- lib/logtail-rails.rb
|
|
341
352
|
- lib/logtail-rails/action_controller.rb
|
|
342
353
|
- lib/logtail-rails/action_controller/log_subscriber.rb
|
data/gemfiles/rails-edge.gemfile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'rails', github: 'rails/rails', branch: 'main'
|
|
4
|
-
gem 'sidekiq', '>= 7.3.0', require: false if RUBY_VERSION >= '2.7.0'
|
|
5
|
-
|
|
6
|
-
gem 'logtail'
|
|
7
|
-
gem 'logtail-rack'
|
|
8
|
-
|
|
9
|
-
if RUBY_PLATFORM == "java"
|
|
10
|
-
gem 'mime-types', '2.6.2'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
gemspec :path => '../'
|