logtail-rails 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -8
  3. data/example-project/.gitattributes +7 -0
  4. data/example-project/.gitignore +35 -0
  5. data/example-project/Gemfile +74 -0
  6. data/example-project/README.md +12 -6
  7. data/example-project/app/assets/config/manifest.js +4 -0
  8. data/example-project/app/assets/images/.keep +0 -0
  9. data/example-project/app/controllers/concerns/.keep +0 -0
  10. data/example-project/{Logtail-rails-main/app → app}/controllers/example_controller.rb +6 -1
  11. data/example-project/app/javascript/application.js +3 -0
  12. data/example-project/app/javascript/controllers/application.js +9 -0
  13. data/example-project/app/javascript/controllers/hello_controller.js +7 -0
  14. data/example-project/app/javascript/controllers/index.js +11 -0
  15. data/example-project/app/models/concerns/.keep +0 -0
  16. data/example-project/bin/bundle +114 -0
  17. data/example-project/bin/importmap +4 -0
  18. data/example-project/{Logtail-rails-main/bin → bin}/rails +0 -0
  19. data/example-project/{Logtail-rails-main/bin → bin}/rake +0 -0
  20. data/example-project/{Logtail-rails-main/bin → bin}/setup +0 -0
  21. data/example-project/{Logtail-rails-main/config → config}/application.rb +3 -1
  22. data/example-project/{Logtail-rails-main/config → config}/cable.yml +3 -2
  23. data/example-project/config/credentials.yml.enc +1 -0
  24. data/example-project/{Logtail-rails-main/config → config}/environments/production.rb +1 -1
  25. data/example-project/config/importmap.rb +7 -0
  26. data/example-project/{Logtail-rails-main/config → config}/initializers/content_security_policy.rb +4 -5
  27. data/example-project/db/seeds.rb +7 -0
  28. data/example-project/lib/assets/.keep +0 -0
  29. data/example-project/lib/tasks/.keep +0 -0
  30. data/example-project/log/.keep +0 -0
  31. data/example-project/public/404.html +67 -0
  32. data/example-project/public/422.html +67 -0
  33. data/example-project/public/500.html +66 -0
  34. data/example-project/public/apple-touch-icon-precomposed.png +0 -0
  35. data/example-project/public/apple-touch-icon.png +0 -0
  36. data/example-project/public/favicon.ico +0 -0
  37. data/example-project/public/robots.txt +1 -0
  38. data/example-project/storage/.keep +0 -0
  39. data/example-project/test/controllers/.keep +0 -0
  40. data/example-project/test/fixtures/files/.keep +0 -0
  41. data/example-project/test/helpers/.keep +0 -0
  42. data/example-project/test/integration/.keep +0 -0
  43. data/example-project/test/mailers/.keep +0 -0
  44. data/example-project/test/models/.keep +0 -0
  45. data/example-project/test/system/.keep +0 -0
  46. data/example-project/tmp/.keep +0 -0
  47. data/example-project/tmp/pids/.keep +0 -0
  48. data/example-project/tmp/storage/.keep +0 -0
  49. data/example-project/vendor/.keep +0 -0
  50. data/example-project/vendor/javascript/.keep +0 -0
  51. data/lib/logtail-rails/log_entry.rb +14 -0
  52. data/lib/logtail-rails/logger.rb +19 -1
  53. data/lib/logtail-rails/overrides/active_support_tagged_logging.rb +1 -1
  54. data/lib/logtail-rails/version.rb +1 -1
  55. data/lib/logtail-rails.rb +1 -1
  56. data/logtail-rails.gemspec +2 -2
  57. metadata +85 -50
  58. data/example-project/Logtail-rails-main/app/assets/config/manifest.js +0 -2
  59. data/example-project/Logtail-rails-main/config/credentials.yml.enc +0 -1
  60. data/example-project/Logtail-rails-main/config/initializers/logtail.rb +0 -6
  61. data/example-project/Logtail-rails-main/test/controllers/example_controller_test.rb +0 -7
  62. data/lib/logtail-rails/tasks/logtail.rake +0 -57
  63. /data/example-project/{Logtail-rails-main/Rakefile → Rakefile} +0 -0
  64. /data/example-project/{Logtail-rails-main/app → app}/assets/stylesheets/application.css +0 -0
  65. /data/example-project/{Logtail-rails-main/app → app}/channels/application_cable/channel.rb +0 -0
  66. /data/example-project/{Logtail-rails-main/app → app}/channels/application_cable/connection.rb +0 -0
  67. /data/example-project/{Logtail-rails-main/app → app}/controllers/application_controller.rb +0 -0
  68. /data/example-project/{Logtail-rails-main/app → app}/helpers/application_helper.rb +0 -0
  69. /data/example-project/{Logtail-rails-main/app → app}/helpers/example_helper.rb +0 -0
  70. /data/example-project/{Logtail-rails-main/app → app}/jobs/application_job.rb +0 -0
  71. /data/example-project/{Logtail-rails-main/app → app}/mailers/application_mailer.rb +0 -0
  72. /data/example-project/{Logtail-rails-main/app → app}/models/application_record.rb +0 -0
  73. /data/example-project/{Logtail-rails-main/app → app}/views/example/index.html.erb +0 -0
  74. /data/example-project/{Logtail-rails-main/app → app}/views/example/send_logs.html.erb +0 -0
  75. /data/example-project/{Logtail-rails-main/app → app}/views/layouts/application.html.erb +0 -0
  76. /data/example-project/{Logtail-rails-main/app → app}/views/layouts/mailer.html.erb +0 -0
  77. /data/example-project/{Logtail-rails-main/app → app}/views/layouts/mailer.text.erb +0 -0
  78. /data/example-project/{Logtail-rails-main/config → config}/boot.rb +0 -0
  79. /data/example-project/{Logtail-rails-main/config → config}/database.yml +0 -0
  80. /data/example-project/{Logtail-rails-main/config → config}/environment.rb +0 -0
  81. /data/example-project/{Logtail-rails-main/config → config}/environments/development.rb +0 -0
  82. /data/example-project/{Logtail-rails-main/config → config}/environments/test.rb +0 -0
  83. /data/example-project/{Logtail-rails-main/config → config}/initializers/assets.rb +0 -0
  84. /data/example-project/{Logtail-rails-main/config → config}/initializers/filter_parameter_logging.rb +0 -0
  85. /data/example-project/{Logtail-rails-main/config → config}/initializers/inflections.rb +0 -0
  86. /data/example-project/{Logtail-rails-main/config → config}/initializers/permissions_policy.rb +0 -0
  87. /data/example-project/{Logtail-rails-main/config → config}/locales/en.yml +0 -0
  88. /data/example-project/{Logtail-rails-main/config → config}/puma.rb +0 -0
  89. /data/example-project/{Logtail-rails-main/config → config}/routes.rb +0 -0
  90. /data/example-project/{Logtail-rails-main/config → config}/storage.yml +0 -0
  91. /data/example-project/{Logtail-rails-main/config.ru → config.ru} +0 -0
  92. /data/example-project/{Logtail-rails-main/test → test}/application_system_test_case.rb +0 -0
  93. /data/example-project/{Logtail-rails-main/test → test}/channels/application_cable/connection_test.rb +0 -0
  94. /data/example-project/{Logtail-rails-main/test → test}/test_helper.rb +0 -0
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ .rails-default-error-page {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ .rails-default-error-page div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ .rails-default-error-page div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ .rails-default-error-page h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ .rails-default-error-page div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="rails-default-error-page">
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
File without changes
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ module Logtail
2
+ class LogEntry
3
+ alias to_hash_unfiltered to_hash
4
+
5
+ def to_hash(options = {})
6
+ hash = to_hash_unfiltered(options)
7
+ return hash unless defined?(ActiveSupport::ParameterFilter)
8
+
9
+ parameter_filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
10
+
11
+ parameter_filter.filter(hash)
12
+ end
13
+ end
14
+ end
@@ -15,6 +15,24 @@ module Logtail
15
15
  elsif defined?(::LoggerSilence)
16
16
  include ::LoggerSilence
17
17
  end
18
+
19
+ def self.create_logger(*io_devices_and_loggers)
20
+ logger = Logtail::Logger.new(*io_devices_and_loggers)
21
+
22
+ tagged_logging_supported = Rails::VERSION::MAJOR >= 7 || Rails::VERSION::MAJOR == 6 && Rails::VERSION::MINOR >= 1
23
+ logger = ::ActiveSupport::TaggedLogging.new(logger) if tagged_logging_supported
24
+
25
+ logger
26
+ end
27
+
28
+ def self.create_default_logger(source_token)
29
+ if ENV['LOGTAIL_SKIP_LOGS'].blank? && !Rails.env.test?
30
+ io_device = Logtail::LogDevices::HTTP.new(source_token)
31
+ else
32
+ io_device = STDOUT
33
+ end
34
+
35
+ self.create_logger(io_device)
36
+ end
18
37
  end
19
38
  end
20
-
@@ -63,4 +63,4 @@ if defined?(ActiveSupport::TaggedLogging)
63
63
  end
64
64
  end
65
65
  end
66
- end
66
+ end
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rails
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
6
6
  end
7
7
  end
data/lib/logtail-rails.rb CHANGED
@@ -22,6 +22,7 @@ require "logtail-rails/action_dispatch"
22
22
  require "logtail-rails/action_view"
23
23
  require "logtail-rails/active_record"
24
24
 
25
+ require "logtail-rails/log_entry"
25
26
  require "logtail-rails/logger"
26
27
 
27
28
  module Logtail
@@ -65,4 +66,3 @@ module Logtail
65
66
  end
66
67
  end
67
68
  end
68
-
@@ -6,9 +6,9 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "logtail-rails"
7
7
  spec.version = Logtail::Integrations::Rails::VERSION
8
8
  spec.authors = ["Logtail"]
9
- spec.email = ["hi@logtail.com"]
9
+ spec.email = ["hello@betterstack.com"]
10
10
 
11
- spec.summary = %q{Logtail.com Rails integration}
11
+ spec.summary = %q{Better Stack Rails integration}
12
12
  spec.homepage = "https://github.com/logtail/logtail-ruby-rails"
13
13
  spec.license = "ISC"
14
14
 
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.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logtail
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-17 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logtail
@@ -208,7 +208,7 @@ dependencies:
208
208
  version: 1.4.0
209
209
  description:
210
210
  email:
211
- - hi@logtail.com
211
+ - hello@betterstack.com
212
212
  executables: []
213
213
  extensions: []
214
214
  extra_rdoc_files: []
@@ -220,51 +220,86 @@ files:
220
220
  - LICENSE.md
221
221
  - README.md
222
222
  - Rakefile
223
- - example-project/Logtail-rails-main/Rakefile
224
- - example-project/Logtail-rails-main/app/assets/config/manifest.js
225
- - example-project/Logtail-rails-main/app/assets/stylesheets/application.css
226
- - example-project/Logtail-rails-main/app/channels/application_cable/channel.rb
227
- - example-project/Logtail-rails-main/app/channels/application_cable/connection.rb
228
- - example-project/Logtail-rails-main/app/controllers/application_controller.rb
229
- - example-project/Logtail-rails-main/app/controllers/example_controller.rb
230
- - example-project/Logtail-rails-main/app/helpers/application_helper.rb
231
- - example-project/Logtail-rails-main/app/helpers/example_helper.rb
232
- - example-project/Logtail-rails-main/app/jobs/application_job.rb
233
- - example-project/Logtail-rails-main/app/mailers/application_mailer.rb
234
- - example-project/Logtail-rails-main/app/models/application_record.rb
235
- - example-project/Logtail-rails-main/app/views/example/index.html.erb
236
- - example-project/Logtail-rails-main/app/views/example/send_logs.html.erb
237
- - example-project/Logtail-rails-main/app/views/layouts/application.html.erb
238
- - example-project/Logtail-rails-main/app/views/layouts/mailer.html.erb
239
- - example-project/Logtail-rails-main/app/views/layouts/mailer.text.erb
240
- - example-project/Logtail-rails-main/bin/rails
241
- - example-project/Logtail-rails-main/bin/rake
242
- - example-project/Logtail-rails-main/bin/setup
243
- - example-project/Logtail-rails-main/config.ru
244
- - example-project/Logtail-rails-main/config/application.rb
245
- - example-project/Logtail-rails-main/config/boot.rb
246
- - example-project/Logtail-rails-main/config/cable.yml
247
- - example-project/Logtail-rails-main/config/credentials.yml.enc
248
- - example-project/Logtail-rails-main/config/database.yml
249
- - example-project/Logtail-rails-main/config/environment.rb
250
- - example-project/Logtail-rails-main/config/environments/development.rb
251
- - example-project/Logtail-rails-main/config/environments/production.rb
252
- - example-project/Logtail-rails-main/config/environments/test.rb
253
- - example-project/Logtail-rails-main/config/initializers/assets.rb
254
- - example-project/Logtail-rails-main/config/initializers/content_security_policy.rb
255
- - example-project/Logtail-rails-main/config/initializers/filter_parameter_logging.rb
256
- - example-project/Logtail-rails-main/config/initializers/inflections.rb
257
- - example-project/Logtail-rails-main/config/initializers/logtail.rb
258
- - example-project/Logtail-rails-main/config/initializers/permissions_policy.rb
259
- - example-project/Logtail-rails-main/config/locales/en.yml
260
- - example-project/Logtail-rails-main/config/puma.rb
261
- - example-project/Logtail-rails-main/config/routes.rb
262
- - example-project/Logtail-rails-main/config/storage.yml
263
- - example-project/Logtail-rails-main/test/application_system_test_case.rb
264
- - example-project/Logtail-rails-main/test/channels/application_cable/connection_test.rb
265
- - example-project/Logtail-rails-main/test/controllers/example_controller_test.rb
266
- - example-project/Logtail-rails-main/test/test_helper.rb
223
+ - example-project/.gitattributes
224
+ - example-project/.gitignore
225
+ - example-project/Gemfile
267
226
  - example-project/README.md
227
+ - example-project/Rakefile
228
+ - example-project/app/assets/config/manifest.js
229
+ - example-project/app/assets/images/.keep
230
+ - example-project/app/assets/stylesheets/application.css
231
+ - example-project/app/channels/application_cable/channel.rb
232
+ - example-project/app/channels/application_cable/connection.rb
233
+ - example-project/app/controllers/application_controller.rb
234
+ - example-project/app/controllers/concerns/.keep
235
+ - example-project/app/controllers/example_controller.rb
236
+ - example-project/app/helpers/application_helper.rb
237
+ - example-project/app/helpers/example_helper.rb
238
+ - example-project/app/javascript/application.js
239
+ - example-project/app/javascript/controllers/application.js
240
+ - example-project/app/javascript/controllers/hello_controller.js
241
+ - example-project/app/javascript/controllers/index.js
242
+ - example-project/app/jobs/application_job.rb
243
+ - example-project/app/mailers/application_mailer.rb
244
+ - example-project/app/models/application_record.rb
245
+ - example-project/app/models/concerns/.keep
246
+ - example-project/app/views/example/index.html.erb
247
+ - example-project/app/views/example/send_logs.html.erb
248
+ - example-project/app/views/layouts/application.html.erb
249
+ - example-project/app/views/layouts/mailer.html.erb
250
+ - example-project/app/views/layouts/mailer.text.erb
251
+ - example-project/bin/bundle
252
+ - example-project/bin/importmap
253
+ - example-project/bin/rails
254
+ - example-project/bin/rake
255
+ - example-project/bin/setup
256
+ - example-project/config.ru
257
+ - example-project/config/application.rb
258
+ - example-project/config/boot.rb
259
+ - example-project/config/cable.yml
260
+ - example-project/config/credentials.yml.enc
261
+ - example-project/config/database.yml
262
+ - example-project/config/environment.rb
263
+ - example-project/config/environments/development.rb
264
+ - example-project/config/environments/production.rb
265
+ - example-project/config/environments/test.rb
266
+ - example-project/config/importmap.rb
267
+ - example-project/config/initializers/assets.rb
268
+ - example-project/config/initializers/content_security_policy.rb
269
+ - example-project/config/initializers/filter_parameter_logging.rb
270
+ - example-project/config/initializers/inflections.rb
271
+ - example-project/config/initializers/permissions_policy.rb
272
+ - example-project/config/locales/en.yml
273
+ - example-project/config/puma.rb
274
+ - example-project/config/routes.rb
275
+ - example-project/config/storage.yml
276
+ - example-project/db/seeds.rb
277
+ - example-project/lib/assets/.keep
278
+ - example-project/lib/tasks/.keep
279
+ - example-project/log/.keep
280
+ - example-project/public/404.html
281
+ - example-project/public/422.html
282
+ - example-project/public/500.html
283
+ - example-project/public/apple-touch-icon-precomposed.png
284
+ - example-project/public/apple-touch-icon.png
285
+ - example-project/public/favicon.ico
286
+ - example-project/public/robots.txt
287
+ - example-project/storage/.keep
288
+ - example-project/test/application_system_test_case.rb
289
+ - example-project/test/channels/application_cable/connection_test.rb
290
+ - example-project/test/controllers/.keep
291
+ - example-project/test/fixtures/files/.keep
292
+ - example-project/test/helpers/.keep
293
+ - example-project/test/integration/.keep
294
+ - example-project/test/mailers/.keep
295
+ - example-project/test/models/.keep
296
+ - example-project/test/system/.keep
297
+ - example-project/test/test_helper.rb
298
+ - example-project/tmp/.keep
299
+ - example-project/tmp/pids/.keep
300
+ - example-project/tmp/storage/.keep
301
+ - example-project/vendor/.keep
302
+ - example-project/vendor/javascript/.keep
268
303
  - gemfiles/rails-3.0.gemfile
269
304
  - gemfiles/rails-3.1.gemfile
270
305
  - gemfiles/rails-3.2.gemfile
@@ -295,6 +330,7 @@ files:
295
330
  - lib/logtail-rails/config/action_view.rb
296
331
  - lib/logtail-rails/config/active_record.rb
297
332
  - lib/logtail-rails/error_event.rb
333
+ - lib/logtail-rails/log_entry.rb
298
334
  - lib/logtail-rails/logger.rb
299
335
  - lib/logtail-rails/overrides.rb
300
336
  - lib/logtail-rails/overrides/active_support_3_tagged_logging.rb
@@ -305,7 +341,6 @@ files:
305
341
  - lib/logtail-rails/rack_logger.rb
306
342
  - lib/logtail-rails/railtie.rb
307
343
  - lib/logtail-rails/session_context.rb
308
- - lib/logtail-rails/tasks/logtail.rake
309
344
  - lib/logtail-rails/version.rb
310
345
  - logtail-rails.gemspec
311
346
  homepage: https://github.com/logtail/logtail-ruby-rails
@@ -330,8 +365,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
365
  - !ruby/object:Gem::Version
331
366
  version: '0'
332
367
  requirements: []
333
- rubygems_version: 3.3.3
368
+ rubygems_version: 3.3.7
334
369
  signing_key:
335
370
  specification_version: 4
336
- summary: Logtail.com Rails integration
371
+ summary: Better Stack Rails integration
337
372
  test_files: []
@@ -1,2 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../stylesheets .css
@@ -1 +0,0 @@
1
- /oo/MoIWYd/RzSBWDWV3JYZ4pYEOSE4xcZi6dGbLt+QwHfQ57XLx4JI0LtBoKgu3ngdmWN2wCo1g25Y9hUOrnashiibq2wPSxJ6AJ28vtEbZf9I/zlVqlXBoWcQf2zQby3EqJ1vu66QdPmi8DzKE+WrgDkdM/VEVB74O4SttiZnhXzOTI7AOOnHs4QrWD31z/mJvJ2ujQ8PqOgLqHDB7FdUZnaiKDcua1YufJuSTOSeMlsY4QbndHccPW1yk7/m2Hw+TwXO47eQ1wypJH4+wlgFf0M4dwL7so7iJo344gHfxgDbB7XsSjCuY03Hz+09Mn/chGh4Tph6v9cikmQTkjLVhOFMy2W2RwFAmtLiqBcInVUkGzDIB2IMacI+icjXFsZuCB5DldQeQ2F0c+2R48eAafbEa2kPPTkzC--zWoiSA3j0KBnrbHx--eQ+1lyd10SbjpZ144VEAXA==
@@ -1,6 +0,0 @@
1
- if ENV['LOGTAIL_SKIP_LOGS'].blank? && !Rails.env.test?
2
- http_device = Logtail::LogDevices::HTTP.new('fKZJDFD11XoK693LdMTiQpuM')
3
- Rails.logger = Logtail::Logger.new(http_device)
4
- else
5
- Rails.logger = Logtail::Logger.new(STDOUT)
6
- end
@@ -1,7 +0,0 @@
1
- require "test_helper"
2
-
3
- class ExampleControllerTest < ActionDispatch::IntegrationTest
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,57 +0,0 @@
1
- namespace :logtail do
2
- desc 'Install a default config/initializers/logtail.rb file'
3
-
4
- PLACEHOLDER = '<SOURCE_TOKEN>'.freeze
5
- def content(source_token = nil)
6
- <<~RUBY
7
- if ENV['LOGTAIL_SKIP_LOGS'].blank? && !Rails.env.test?
8
- http_device = Logtail::LogDevices::HTTP.new('#{source_token || PLACEHOLDER}')
9
- Rails.logger = Logtail::Logger.new(http_device)
10
- else
11
- Rails.logger = Logtail::Logger.new(STDOUT)
12
- end
13
- RUBY
14
- end
15
-
16
- task install: :environment do
17
- quiet = ENV['quiet']
18
- force = ENV['force']
19
- source_token = ENV['source_token']
20
-
21
- config_file = 'config/initializers/logtail.rb'
22
-
23
- if File.exist?(config_file) && !force
24
- puts "logtail.rb file already exists. Use `rake logtail:install force=true` to overwrite."
25
- next
26
- end
27
-
28
- File.open(config_file, 'w') { |out| out.puts(content(source_token)) }
29
-
30
- return if quiet
31
-
32
- if source_token.nil? || source_token == ''
33
- puts <<~EOF
34
- Installed a default configuration file at #{config_file}.
35
- EOF
36
-
37
- puts <<~EOF
38
- To monitor your logs in production mode, sign up for an account
39
- at logtail.com, and replace the source token in the logtail.rb file
40
- with the one you receive upon registration.
41
- EOF
42
-
43
- puts <<~EOF
44
- Visit logtail.com/help if you are experiencing installation issues.
45
- EOF
46
- else
47
- puts <<~EOF
48
- Installed a configuration file at #{config_file} with a source token
49
- ending with '#{source_token[-4..-1]}'.
50
- EOF
51
-
52
- puts <<~EOF
53
- Visit logtail.com/help if you are experiencing installation issues.
54
- EOF
55
- end
56
- end
57
- end