logtail-rails 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +91 -4
  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 +211 -0
  7. data/example-project/Rakefile +6 -0
  8. data/example-project/app/assets/config/manifest.js +4 -0
  9. data/example-project/app/assets/images/.keep +0 -0
  10. data/example-project/app/assets/stylesheets/application.css +15 -0
  11. data/example-project/app/channels/application_cable/channel.rb +4 -0
  12. data/example-project/app/channels/application_cable/connection.rb +4 -0
  13. data/example-project/app/controllers/application_controller.rb +2 -0
  14. data/example-project/app/controllers/concerns/.keep +0 -0
  15. data/example-project/app/controllers/example_controller.rb +40 -0
  16. data/example-project/app/helpers/application_helper.rb +2 -0
  17. data/example-project/app/helpers/example_helper.rb +2 -0
  18. data/example-project/app/javascript/application.js +3 -0
  19. data/example-project/app/javascript/controllers/application.js +9 -0
  20. data/example-project/app/javascript/controllers/hello_controller.js +7 -0
  21. data/example-project/app/javascript/controllers/index.js +11 -0
  22. data/example-project/app/jobs/application_job.rb +7 -0
  23. data/example-project/app/mailers/application_mailer.rb +4 -0
  24. data/example-project/app/models/application_record.rb +3 -0
  25. data/example-project/app/models/concerns/.keep +0 -0
  26. data/example-project/app/views/example/index.html.erb +3 -0
  27. data/example-project/app/views/example/send_logs.html.erb +4 -0
  28. data/example-project/app/views/layouts/application.html.erb +15 -0
  29. data/example-project/app/views/layouts/mailer.html.erb +13 -0
  30. data/example-project/app/views/layouts/mailer.text.erb +1 -0
  31. data/example-project/bin/bundle +114 -0
  32. data/example-project/bin/importmap +4 -0
  33. data/example-project/bin/rails +4 -0
  34. data/example-project/bin/rake +4 -0
  35. data/example-project/bin/setup +33 -0
  36. data/example-project/config/application.rb +24 -0
  37. data/example-project/config/boot.rb +4 -0
  38. data/example-project/config/cable.yml +11 -0
  39. data/example-project/config/credentials.yml.enc +1 -0
  40. data/example-project/config/database.yml +25 -0
  41. data/example-project/config/environment.rb +5 -0
  42. data/example-project/config/environments/development.rb +70 -0
  43. data/example-project/config/environments/production.rb +93 -0
  44. data/example-project/config/environments/test.rb +60 -0
  45. data/example-project/config/importmap.rb +7 -0
  46. data/example-project/config/initializers/assets.rb +12 -0
  47. data/example-project/config/initializers/content_security_policy.rb +25 -0
  48. data/example-project/config/initializers/filter_parameter_logging.rb +8 -0
  49. data/example-project/config/initializers/inflections.rb +16 -0
  50. data/example-project/config/initializers/permissions_policy.rb +11 -0
  51. data/example-project/config/locales/en.yml +33 -0
  52. data/example-project/config/puma.rb +43 -0
  53. data/example-project/config/routes.rb +7 -0
  54. data/example-project/config/storage.yml +34 -0
  55. data/example-project/config.ru +6 -0
  56. data/example-project/db/seeds.rb +7 -0
  57. data/example-project/lib/assets/.keep +0 -0
  58. data/example-project/lib/tasks/.keep +0 -0
  59. data/example-project/log/.keep +0 -0
  60. data/example-project/public/404.html +67 -0
  61. data/example-project/public/422.html +67 -0
  62. data/example-project/public/500.html +66 -0
  63. data/example-project/public/apple-touch-icon-precomposed.png +0 -0
  64. data/example-project/public/apple-touch-icon.png +0 -0
  65. data/example-project/public/favicon.ico +0 -0
  66. data/example-project/public/robots.txt +1 -0
  67. data/example-project/storage/.keep +0 -0
  68. data/example-project/test/application_system_test_case.rb +5 -0
  69. data/example-project/test/channels/application_cable/connection_test.rb +11 -0
  70. data/example-project/test/controllers/.keep +0 -0
  71. data/example-project/test/fixtures/files/.keep +0 -0
  72. data/example-project/test/helpers/.keep +0 -0
  73. data/example-project/test/integration/.keep +0 -0
  74. data/example-project/test/mailers/.keep +0 -0
  75. data/example-project/test/models/.keep +0 -0
  76. data/example-project/test/system/.keep +0 -0
  77. data/example-project/test/test_helper.rb +13 -0
  78. data/example-project/tmp/.keep +0 -0
  79. data/example-project/tmp/pids/.keep +0 -0
  80. data/example-project/tmp/storage/.keep +0 -0
  81. data/example-project/vendor/.keep +0 -0
  82. data/example-project/vendor/javascript/.keep +0 -0
  83. data/lib/logtail-rails/log_entry.rb +14 -0
  84. data/lib/logtail-rails/logger.rb +19 -1
  85. data/lib/logtail-rails/overrides/active_support_tagged_logging.rb +1 -1
  86. data/lib/logtail-rails/version.rb +1 -1
  87. data/lib/logtail-rails.rb +6 -2
  88. data/logtail-rails.gemspec +6 -3
  89. metadata +115 -7
  90. data/lib/logtail-rails/tasks/logtail.rake +0 -57
@@ -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