loga 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +157 -0
  3. data/.codeclimate.yml +4 -0
  4. data/.gitignore +2 -0
  5. data/.rubocop.yml +13 -8
  6. data/Appraisals +16 -6
  7. data/CHANGELOG.md +7 -0
  8. data/Gemfile +0 -1
  9. data/Guardfile +8 -6
  10. data/README.md +1 -0
  11. data/Rakefile +1 -1
  12. data/gemfiles/rails32.gemfile +1 -2
  13. data/gemfiles/rails40.gemfile +1 -2
  14. data/gemfiles/rails42.gemfile +11 -0
  15. data/gemfiles/rails50.gemfile +1 -2
  16. data/gemfiles/rails52.gemfile +11 -0
  17. data/gemfiles/sinatra14.gemfile +1 -2
  18. data/gemfiles/unit.gemfile +1 -2
  19. data/lib/loga.rb +4 -2
  20. data/lib/loga/configuration.rb +5 -5
  21. data/lib/loga/ext/rails/rack/debug_exceptions.rb +1 -2
  22. data/lib/loga/formatters/simple_formatter.rb +1 -1
  23. data/lib/loga/log_subscribers/action_mailer.rb +59 -0
  24. data/lib/loga/rack/logger.rb +1 -1
  25. data/lib/loga/rack/request_id.rb +2 -2
  26. data/lib/loga/railtie.rb +22 -9
  27. data/lib/loga/version.rb +1 -1
  28. data/loga.gemspec +9 -8
  29. data/spec/fixtures/README.md +23 -3
  30. data/spec/fixtures/rails32.rb +79 -0
  31. data/spec/fixtures/rails40.rb +80 -0
  32. data/spec/fixtures/rails42.rb +80 -0
  33. data/spec/fixtures/rails50.rb +80 -0
  34. data/spec/fixtures/rails52.rb +80 -0
  35. data/spec/integration/rails/action_mailer_spec.rb +63 -0
  36. data/spec/integration/rails/railtie_spec.rb +15 -0
  37. data/spec/integration/sinatra_spec.rb +2 -2
  38. data/spec/spec_helper.rb +7 -8
  39. data/spec/support/gethostname_shared.rb +7 -0
  40. data/spec/support/helpers.rb +0 -4
  41. data/spec/unit/loga/configuration_spec.rb +4 -4
  42. data/spec/unit/loga/formatters/gelf_formatter_spec.rb +1 -1
  43. data/spec/unit/loga/formatters/simple_formatter_spec.rb +2 -2
  44. data/spec/unit/loga/log_subscribers/action_mailer_spec.rb +69 -0
  45. data/spec/unit/loga/rack/logger_spec.rb +1 -1
  46. data/spec/unit/loga_spec.rb +1 -1
  47. metadata +71 -225
  48. data/circle.yml +0 -23
  49. data/spec/fixtures/rails32/Rakefile +0 -7
  50. data/spec/fixtures/rails32/app/controllers/application_controller.rb +0 -28
  51. data/spec/fixtures/rails32/app/helpers/application_helper.rb +0 -2
  52. data/spec/fixtures/rails32/app/views/layouts/application.html.erb +0 -14
  53. data/spec/fixtures/rails32/app/views/user.html.erb +0 -1
  54. data/spec/fixtures/rails32/config.ru +0 -4
  55. data/spec/fixtures/rails32/config/application.rb +0 -71
  56. data/spec/fixtures/rails32/config/boot.rb +0 -6
  57. data/spec/fixtures/rails32/config/environment.rb +0 -5
  58. data/spec/fixtures/rails32/config/environments/development.rb +0 -26
  59. data/spec/fixtures/rails32/config/environments/production.rb +0 -50
  60. data/spec/fixtures/rails32/config/environments/test.rb +0 -35
  61. data/spec/fixtures/rails32/config/initializers/backtrace_silencers.rb +0 -7
  62. data/spec/fixtures/rails32/config/initializers/inflections.rb +0 -15
  63. data/spec/fixtures/rails32/config/initializers/mime_types.rb +0 -5
  64. data/spec/fixtures/rails32/config/initializers/secret_token.rb +0 -7
  65. data/spec/fixtures/rails32/config/initializers/session_store.rb +0 -8
  66. data/spec/fixtures/rails32/config/initializers/wrap_parameters.rb +0 -10
  67. data/spec/fixtures/rails32/config/locales/en.yml +0 -5
  68. data/spec/fixtures/rails32/config/routes.rb +0 -64
  69. data/spec/fixtures/rails32/public/404.html +0 -26
  70. data/spec/fixtures/rails32/public/422.html +0 -26
  71. data/spec/fixtures/rails32/public/500.html +0 -25
  72. data/spec/fixtures/rails32/public/favicon.ico +0 -0
  73. data/spec/fixtures/rails32/public/index.html +0 -241
  74. data/spec/fixtures/rails32/public/robots.txt +0 -5
  75. data/spec/fixtures/rails32/script/rails +0 -6
  76. data/spec/fixtures/rails40/Rakefile +0 -6
  77. data/spec/fixtures/rails40/app/controllers/application_controller.rb +0 -30
  78. data/spec/fixtures/rails40/app/helpers/application_helper.rb +0 -2
  79. data/spec/fixtures/rails40/app/views/layouts/application.html.erb +0 -14
  80. data/spec/fixtures/rails40/app/views/user.html.erb +0 -1
  81. data/spec/fixtures/rails40/bin/bundle +0 -3
  82. data/spec/fixtures/rails40/bin/rails +0 -4
  83. data/spec/fixtures/rails40/bin/rake +0 -4
  84. data/spec/fixtures/rails40/config.ru +0 -4
  85. data/spec/fixtures/rails40/config/application.rb +0 -37
  86. data/spec/fixtures/rails40/config/boot.rb +0 -4
  87. data/spec/fixtures/rails40/config/environment.rb +0 -5
  88. data/spec/fixtures/rails40/config/environments/development.rb +0 -24
  89. data/spec/fixtures/rails40/config/environments/production.rb +0 -65
  90. data/spec/fixtures/rails40/config/environments/test.rb +0 -39
  91. data/spec/fixtures/rails40/config/initializers/backtrace_silencers.rb +0 -7
  92. data/spec/fixtures/rails40/config/initializers/filter_parameter_logging.rb +0 -4
  93. data/spec/fixtures/rails40/config/initializers/inflections.rb +0 -16
  94. data/spec/fixtures/rails40/config/initializers/mime_types.rb +0 -5
  95. data/spec/fixtures/rails40/config/initializers/secret_token.rb +0 -12
  96. data/spec/fixtures/rails40/config/initializers/session_store.rb +0 -3
  97. data/spec/fixtures/rails40/config/initializers/wrap_parameters.rb +0 -9
  98. data/spec/fixtures/rails40/config/locales/en.yml +0 -23
  99. data/spec/fixtures/rails40/config/routes.rb +0 -62
  100. data/spec/fixtures/rails40/public/404.html +0 -58
  101. data/spec/fixtures/rails40/public/422.html +0 -58
  102. data/spec/fixtures/rails40/public/500.html +0 -57
  103. data/spec/fixtures/rails40/public/favicon.ico +0 -0
  104. data/spec/fixtures/rails40/public/robots.txt +0 -5
  105. data/spec/fixtures/rails50/Rakefile +0 -6
  106. data/spec/fixtures/rails50/app/controllers/application_controller.rb +0 -28
  107. data/spec/fixtures/rails50/app/helpers/application_helper.rb +0 -2
  108. data/spec/fixtures/rails50/app/views/layouts/application.html.erb +0 -13
  109. data/spec/fixtures/rails50/app/views/user.html.erb +0 -1
  110. data/spec/fixtures/rails50/bin/bundle +0 -3
  111. data/spec/fixtures/rails50/bin/rails +0 -4
  112. data/spec/fixtures/rails50/bin/rake +0 -4
  113. data/spec/fixtures/rails50/bin/setup +0 -34
  114. data/spec/fixtures/rails50/bin/update +0 -29
  115. data/spec/fixtures/rails50/config.ru +0 -5
  116. data/spec/fixtures/rails50/config/application.rb +0 -34
  117. data/spec/fixtures/rails50/config/boot.rb +0 -3
  118. data/spec/fixtures/rails50/config/cable.yml +0 -9
  119. data/spec/fixtures/rails50/config/environment.rb +0 -5
  120. data/spec/fixtures/rails50/config/environments/development.rb +0 -44
  121. data/spec/fixtures/rails50/config/environments/production.rb +0 -75
  122. data/spec/fixtures/rails50/config/environments/test.rb +0 -42
  123. data/spec/fixtures/rails50/config/initializers/application_controller_renderer.rb +0 -6
  124. data/spec/fixtures/rails50/config/initializers/backtrace_silencers.rb +0 -7
  125. data/spec/fixtures/rails50/config/initializers/cookies_serializer.rb +0 -5
  126. data/spec/fixtures/rails50/config/initializers/filter_parameter_logging.rb +0 -4
  127. data/spec/fixtures/rails50/config/initializers/inflections.rb +0 -16
  128. data/spec/fixtures/rails50/config/initializers/mime_types.rb +0 -4
  129. data/spec/fixtures/rails50/config/initializers/new_framework_defaults.rb +0 -21
  130. data/spec/fixtures/rails50/config/initializers/session_store.rb +0 -3
  131. data/spec/fixtures/rails50/config/initializers/wrap_parameters.rb +0 -9
  132. data/spec/fixtures/rails50/config/locales/en.yml +0 -23
  133. data/spec/fixtures/rails50/config/puma.rb +0 -47
  134. data/spec/fixtures/rails50/config/routes.rb +0 -9
  135. data/spec/fixtures/rails50/config/secrets.yml +0 -23
  136. data/spec/fixtures/rails50/public/404.html +0 -67
  137. data/spec/fixtures/rails50/public/422.html +0 -67
  138. data/spec/fixtures/rails50/public/500.html +0 -66
  139. data/spec/fixtures/rails50/public/apple-touch-icon-precomposed.png +0 -0
  140. data/spec/fixtures/rails50/public/apple-touch-icon.png +0 -0
  141. data/spec/fixtures/rails50/public/favicon.ico +0 -0
  142. data/spec/fixtures/rails50/public/robots.txt +0 -5
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, key: '_rails50_session'
@@ -1,9 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
9
- end
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,47 +0,0 @@
1
- # Puma can serve each request in a thread from an internal thread pool.
2
- # The `threads` method setting takes two numbers a minimum and maximum.
3
- # Any libraries that use thread pools should be configured to match
4
- # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
- # and maximum, this matches the default thread size of Active Record.
6
- #
7
- threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
8
- threads threads_count, threads_count
9
-
10
- # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
11
- #
12
- port ENV.fetch("PORT") { 3000 }
13
-
14
- # Specifies the `environment` that Puma will run in.
15
- #
16
- environment ENV.fetch("RAILS_ENV") { "development" }
17
-
18
- # Specifies the number of `workers` to boot in clustered mode.
19
- # Workers are forked webserver processes. If using threads and workers together
20
- # the concurrency of the application would be max `threads` * `workers`.
21
- # Workers do not work on JRuby or Windows (both of which do not support
22
- # processes).
23
- #
24
- # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
-
26
- # Use the `preload_app!` method when specifying a `workers` number.
27
- # This directive tells Puma to first boot the application and load code
28
- # before forking the application. This takes advantage of Copy On Write
29
- # process behavior so workers use less memory. If you use this option
30
- # you need to make sure to reconnect any threads in the `on_worker_boot`
31
- # block.
32
- #
33
- # preload_app!
34
-
35
- # The code in the `on_worker_boot` will be called if you are using
36
- # clustered mode by specifying a number of `workers`. After each worker
37
- # process is booted this block will be run, if you are using `preload_app!`
38
- # option you will want to use this block to reconnect to any threads
39
- # or connections that may have been created at application boot, Ruby
40
- # cannot share connections between processes.
41
- #
42
- # on_worker_boot do
43
- # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
44
- # end
45
-
46
- # Allow puma to be restarted by `rails restart` command.
47
- plugin :tmp_restart
@@ -1,9 +0,0 @@
1
- Rails.application.routes.draw do
2
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3
- get 'ok' => 'application#ok'
4
- get 'error' => 'application#error'
5
- get 'show' => 'application#show'
6
- post 'users' => 'application#create'
7
- get 'new' => 'application#new'
8
- put 'users/:id' => 'application#update'
9
- end
@@ -1,23 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rails secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: 8fd73876e82001fe2404d1eb0c2bd2ba43b6ce9baa2c3c5a6897228dbe110f67b11a38f86b22ddbdd83f021c95de30760a1d08a0f25f491fef45e1d462d1739a
15
-
16
- test:
17
- secret_key_base: 0f433d17cf65c4a7e346bcd50f4dc95fa2cf9591a19af3b70788d168418ecfc4a79b87197630eeed3b2ca3bc1aab9c1b7648e566daef07fff7e3cf15bade12b8
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: 0f433d17cf65c4a7e346bcd50f4dc95fa2cf9591a19af3b70788d168418ecfc4a79b87197630eeed3b2ca3bc1aab9c1b7648e566daef07fff7e3cf15bade12b8
23
-
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- 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
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- 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>
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
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
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- 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
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- 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>
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>
@@ -1,66 +0,0 @@
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
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- 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
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- 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>
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
@@ -1,5 +0,0 @@
1
- # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2
- #
3
- # To ban all spiders from the entire site uncomment the next two lines:
4
- # User-agent: *
5
- # Disallow: /