logster 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -18
  3. data/.travis.yml +15 -15
  4. data/CHANGELOG.md +140 -137
  5. data/Gemfile +4 -4
  6. data/Guardfile +8 -8
  7. data/LICENSE.txt +22 -22
  8. data/README.md +99 -99
  9. data/Rakefile +24 -24
  10. data/assets/fonts/FontAwesome.otf +0 -0
  11. data/assets/fonts/fontawesome-webfont.eot +0 -0
  12. data/assets/fonts/fontawesome-webfont.svg +639 -639
  13. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  14. data/assets/fonts/fontawesome-webfont.woff +0 -0
  15. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  16. data/assets/images/Icon-144_rounded.png +0 -0
  17. data/assets/images/Icon-144_square.png +0 -0
  18. data/assets/images/icon_144x144.png +0 -0
  19. data/assets/images/icon_64x64.png +0 -0
  20. data/assets/javascript/client-app.js +92 -81
  21. data/assets/stylesheets/client-app.css +1 -1
  22. data/build_client_app.sh +0 -0
  23. data/client-app/.editorconfig +20 -20
  24. data/client-app/.ember-cli +9 -9
  25. data/client-app/.eslintignore +19 -19
  26. data/client-app/.eslintrc.js +46 -46
  27. data/client-app/.gitignore +23 -23
  28. data/client-app/.travis.yml +27 -27
  29. data/client-app/.watchmanconfig +3 -3
  30. data/client-app/README.md +57 -57
  31. data/client-app/app/app.js +14 -14
  32. data/client-app/app/components/actions-menu.js +37 -0
  33. data/client-app/app/components/message-info.js +65 -18
  34. data/client-app/app/components/message-row.js +45 -45
  35. data/client-app/app/components/panel-resizer.js +75 -75
  36. data/client-app/app/components/tab-contents.js +27 -27
  37. data/client-app/app/components/tab-link.js +5 -5
  38. data/client-app/app/components/tabbed-section.js +32 -32
  39. data/client-app/app/components/time-formatter.js +25 -25
  40. data/client-app/app/components/update-time.js +21 -21
  41. data/client-app/app/controllers/index.js +92 -83
  42. data/client-app/app/controllers/show.js +13 -13
  43. data/client-app/app/index.html +29 -29
  44. data/client-app/app/initializers/app-init.js +72 -55
  45. data/client-app/app/lib/preload.js +14 -14
  46. data/client-app/app/lib/utilities.js +140 -140
  47. data/client-app/app/models/message-collection.js +158 -158
  48. data/client-app/app/models/message.js +99 -99
  49. data/client-app/app/resolver.js +3 -3
  50. data/client-app/app/router.js +14 -14
  51. data/client-app/app/routes/index.js +57 -53
  52. data/client-app/app/routes/show.js +14 -14
  53. data/client-app/app/styles/app.css +497 -387
  54. data/client-app/app/templates/application.hbs +2 -2
  55. data/client-app/app/templates/components/actions-menu.hbs +12 -0
  56. data/client-app/app/templates/components/message-info.hbs +41 -44
  57. data/client-app/app/templates/components/message-row.hbs +17 -17
  58. data/client-app/app/templates/components/panel-resizer.hbs +3 -0
  59. data/client-app/app/templates/components/tabbed-section.hbs +10 -10
  60. data/client-app/app/templates/components/time-formatter.hbs +1 -1
  61. data/client-app/app/templates/index.hbs +65 -57
  62. data/client-app/app/templates/show.hbs +7 -4
  63. data/client-app/config/environment.js +51 -51
  64. data/client-app/config/optional-features.json +3 -3
  65. data/client-app/config/targets.js +18 -18
  66. data/client-app/ember-cli-build.js +29 -29
  67. data/client-app/package-lock.json +11365 -11365
  68. data/client-app/package.json +56 -56
  69. data/client-app/testem.js +25 -25
  70. data/client-app/tests/index.html +34 -34
  71. data/client-app/tests/integration/components/actions-menu-test.js +26 -0
  72. data/client-app/tests/integration/components/message-info-test.js +26 -26
  73. data/client-app/tests/integration/components/message-row-test.js +26 -26
  74. data/client-app/tests/integration/components/panel-resizer-test.js +26 -26
  75. data/client-app/tests/integration/components/tab-contents-test.js +26 -26
  76. data/client-app/tests/integration/components/tab-link-test.js +26 -26
  77. data/client-app/tests/integration/components/tabbed-section-test.js +26 -26
  78. data/client-app/tests/integration/components/time-formatter-test.js +26 -26
  79. data/client-app/tests/integration/components/update-time-test.js +26 -26
  80. data/client-app/tests/test-helper.js +8 -8
  81. data/client-app/tests/unit/controllers/index-test.js +12 -12
  82. data/client-app/tests/unit/controllers/show-test.js +12 -12
  83. data/client-app/tests/unit/initializers/app-init-test.js +31 -31
  84. data/client-app/tests/unit/routes/index-test.js +11 -11
  85. data/client-app/tests/unit/routes/show-test.js +11 -11
  86. data/lib/examples/sidekiq_logster_reporter.rb +21 -21
  87. data/lib/logster.rb +54 -54
  88. data/lib/logster/base_store.rb +130 -130
  89. data/lib/logster/configuration.rb +25 -25
  90. data/lib/logster/ignore_pattern.rb +65 -65
  91. data/lib/logster/logger.rb +108 -108
  92. data/lib/logster/message.rb +227 -227
  93. data/lib/logster/middleware/debug_exceptions.rb +26 -26
  94. data/lib/logster/middleware/reporter.rb +56 -56
  95. data/lib/logster/middleware/viewer.rb +221 -220
  96. data/lib/logster/rails/railtie.rb +58 -58
  97. data/lib/logster/redis_store.rb +481 -481
  98. data/lib/logster/version.rb +3 -3
  99. data/lib/logster/web.rb +14 -14
  100. data/logster.gemspec +34 -34
  101. data/test/examples/test_sidekiq_reporter_example.rb +46 -46
  102. data/test/fake_data/Gemfile +4 -4
  103. data/test/fake_data/generate.rb +10 -10
  104. data/test/logster/middleware/test_reporter.rb +21 -21
  105. data/test/logster/middleware/test_viewer.rb +96 -96
  106. data/test/logster/test_base_store.rb +147 -147
  107. data/test/logster/test_ignore_pattern.rb +41 -41
  108. data/test/logster/test_logger.rb +80 -80
  109. data/test/logster/test_message.rb +34 -34
  110. data/test/logster/test_redis_rate_limiter.rb +230 -230
  111. data/test/logster/test_redis_store.rb +427 -427
  112. data/test/test_helper.rb +38 -38
  113. data/vendor/assets/javascripts/logster.js.erb +39 -39
  114. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e5e9decebe1a9a3e0d342200b5ece0d9447fd3bf7e27eb51ef34b26e1a1bbb9
4
- data.tar.gz: 1a07e2040921e6dad703a03d43a1e8eb6394a24061237b6515b53e0a82cc0b99
3
+ metadata.gz: 1b8b547dcfd6fb1cc5d425ad2b7399eff92e9531d3d9bf1f32f83d51934382ec
4
+ data.tar.gz: 282e506df1fe66e9ba573c52c5af6321527679e7a3ec35c3c3c5d5e283f32590
5
5
  SHA512:
6
- metadata.gz: 7f4d6c0dc19e829e25a0e5b7df21661137a60a43b5e646f7160bfae4f0e58709a46890d49ad11576956af992dd6122a69dc67bf15305a5826df9c71439e3cbe8
7
- data.tar.gz: 1ff7baa54f12266289573a6481860f1e193b3695d4287086e35416a1a630068a5d24cd7a232e1d2f4705fa892abc3a7d580994df27318a836ea2f8b6556f5559
6
+ metadata.gz: 011d87d3746ad752d68d04c526b3ac6181ca5f1c4342f37d2c049f541cf641d52fcd3e5c8a0e9085949a7de11b46cd001d2a12fd79d1be0cbce204b1bb90f6e7
7
+ data.tar.gz: ed50cb5333f2b85f698cebb9e2bc380247421b21e384c886c20889d8c90839222deed925908cc8f1888abaf6303f487fdeac1e13b365967ff2e74b4b5fe28014
data/.gitignore CHANGED
@@ -1,18 +1,18 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .byebug_history
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .byebug_history
@@ -1,15 +1,15 @@
1
- language: ruby
2
-
3
- matrix:
4
- fast_finish: true
5
-
6
- rvm:
7
- - 2.3.4
8
-
9
- services:
10
- - redis-server
11
-
12
- before_install:
13
- - gem install bundler
14
-
15
- sudo: false
1
+ language: ruby
2
+
3
+ matrix:
4
+ fast_finish: true
5
+
6
+ rvm:
7
+ - 2.3.4
8
+
9
+ services:
10
+ - redis-server
11
+
12
+ before_install:
13
+ - gem install bundler
14
+
15
+ sudo: false
@@ -1,137 +1,140 @@
1
- # CHANGELOG
2
-
3
- - 2018-11-09: Version 1.3.1
4
- - Feature: auto scrub invalid messages reported to logger
5
-
6
- - 2018-11-09: Version 1.3.0
7
- - Feature: upgrade Ember to 3.5.1
8
- - Feature: remove inline JS for CSP compliance
9
-
10
- - 2018-08-13: Version 1.2.10
11
- - Feature: expose chained loggers in Logster::Logger
12
-
13
- - 2017-10-27: Version 1.2.8
14
- - Fix: `Logster::Middleware::DebugExceptions` is passed a request in Rails 5 instead of the env.
15
-
16
- - 2017-01-30: Version 1.2.7
17
- - Feature: Add override_level to Logster::Logger allowing for threadsafe logger override
18
-
19
- - 2016-10-24: Version 1.2.6
20
- - Fix: Check if `Rails.env` is defined when using Logster in a none Rails project.
21
-
22
- - 2016-07-11: Version 1.2.5
23
- - Fix: Chained `Logster::Logger` logger now receives backtrace as well.
24
-
25
- - 2016-05-05: Version 1.2.4
26
- - Fix: XSS in log message show if attacker can inject script into ENV
27
-
28
- - 2016-05-05: Version 1.2.3
29
- - Fix: clear_all now also clears rate limits
30
- - Fix: protect against corrupt data in redis during clear
31
-
32
- - 2016-03-22: Version 1.2.2
33
- - Fix: Conflicting attributes and method name for `Logster::RedisStore#rate_limits`.
34
- - Fix: Rate limit checker was tracking limits too early. It should only track when a message has been bumped or saved.
35
-
36
- - 2016-03-22: Version 1.2.1
37
- - Feature: Add method to retrieve current rate from rate limiters.
38
- - Feature: Make `RedisStore#rate_limits` readable.
39
- - Feature: Make `RedisRateLimiter#callback` and `RedisRateLimiter#duration` readable.
40
-
41
- - 2016-03-18: Version 1.2.0
42
- - Fix: Move Redis configuration into RedisStore.
43
- - Feature: Allow `RedisStore#redis_prefix` to either be a String or a Proc.
44
-
45
- - 2016-02-11: Version 1.1.1
46
- - Feature: Error rate can now be tracked in one minute and one hour buckets.
47
-
48
- - 2015-11-27: Version 1.0.1
49
- - New assets and logster logo
50
- - Added favicon
51
- - Added title
52
- - Use rails logger instead of invoking store
53
-
54
- - 2015-08-18: Version 0.9.9
55
- - This marks the largest release of Logster to date, it has been in production use for quite a while, hence the version bump.
56
- - Feature: automatically group errors in production mode, can be manually controlled via Logster.config.allow_grouping
57
- - Feature: automatically track application version, can be manually controlled via Logster.config.application_version
58
- - Feature: Font Awesome icons used throughout
59
- - Feature: Ember upgrade to 1.13
60
- - Feature: you can now "solve" a class of errors, if error has an application_version and backtrace. Once an error is solved it will no longer be reported for the "solved" application_versions
61
- - Feature: allow users to delete a single error
62
- - UX: use table for env
63
- - Feature: display "protected" state of message in list
64
- - Feature: use local times as opposed to relative times in time column
65
- - UX: use Google Roboto font as opposed to system fonts
66
- - UX: remove pointless titles from log table
67
- - Feature: If Logster is in a background tab only poll once every 60 seconds (as opposed to 3)
68
- - Fix: protect/unprotect redirected to show page
69
-
70
- - 2015-06-16: Version 0.8.3
71
- - Chained loggers now respect chain ignore
72
- - Add hostname and process_id to env on all messages
73
-
74
- - 2015-06-10: Version 0.8.2
75
- - Add hostname and process_id to env on all messages
76
-
77
- - 2015-05-01: Version 0.8.1
78
- - Don't crash out logging routine if redis is down or stderr is closed
79
-
80
- - 2015-04-16: Version 0.8.0
81
- - Improve formatting of /show page
82
- - Big version bump cause it is quite stable
83
-
84
- - 2015-02-27: Version 0.1.7
85
- - Fix invalid request on ?test
86
-
87
- - 2014-08-05: Version 0.1.3
88
- - Automatically include ignore filter
89
-
90
- - 2014-08-13: Version 0.1.6
91
- - Simplify install process
92
- - Fix crash on 404 in /logs dir
93
-
94
- - 2014-08-10: Version 0.1.5
95
- - Fix crash in Rails 3
96
-
97
- - 2014-08-08: Version 0.1.4
98
- - Fix crash in ignore filter
99
-
100
- - 2014-07-17: Version 0.1.1
101
- - Refactored report method into base_store.rb - will be easier to make a new log store
102
- - Add link in UI to clear all (non-protected) logs
103
- - Add example of submitting logs from Sidekiq jobs
104
- - Show Protect/Share links on all tabs
105
- - Render hashes provided via Logster.add_to_env
106
-
107
- - 2014-07-04: Version 0.0.12
108
- - Feature: Able to share logs, at /logs/show/(hexdigits)
109
- - Add protecting logs, so they aren't deleted when old (for use with sharing)
110
- - Restructured Redis data model
111
-
112
- - 2014-05-24: Version 0.0.10
113
- - Correct context for error reporting
114
- - Clean up backtraces of reported exceptions
115
-
116
- - 2014-05-13: Version 0.0.9
117
- - Stray debugger message removed, add window.location logging to js
118
-
119
- - 2014-05-13: Version 0.0.8
120
- - Fix pacakging binstubs by mistake
121
-
122
- - 2014-05-13: Version 0.0.7
123
- - Add support for javascript exception logging
124
-
125
- - 2014-05-12: Version 0.0.6
126
- - Add referer to env
127
-
128
- - 2014-05-12: Version 0.0.5
129
- - Feature: We now log basic rack environment with the messages
130
- - Add your own with Logster.add_to_env(env, key, value)
131
-
132
- - 2014-05-07: Version 0.0.4
133
- - Feature: Ability to ignore patterns with Logster.store.ignore = [/regex/]
134
- - Feature: Store backtraces, allow people to view them in the GUI
135
-
136
- - 2014-05-07: Started changelog :)
137
- - Report params in env tab
1
+ # CHANGELOG
2
+
3
+ - 2018-12-25: Version 1.3.2
4
+ - UX: improve usability on mobile
5
+
6
+ - 2018-11-09: Version 1.3.1
7
+ - Feature: auto scrub invalid messages reported to logger
8
+
9
+ - 2018-11-09: Version 1.3.0
10
+ - Feature: upgrade Ember to 3.5.1
11
+ - Feature: remove inline JS for CSP compliance
12
+
13
+ - 2018-08-13: Version 1.2.10
14
+ - Feature: expose chained loggers in Logster::Logger
15
+
16
+ - 2017-10-27: Version 1.2.8
17
+ - Fix: `Logster::Middleware::DebugExceptions` is passed a request in Rails 5 instead of the env.
18
+
19
+ - 2017-01-30: Version 1.2.7
20
+ - Feature: Add override_level to Logster::Logger allowing for threadsafe logger override
21
+
22
+ - 2016-10-24: Version 1.2.6
23
+ - Fix: Check if `Rails.env` is defined when using Logster in a none Rails project.
24
+
25
+ - 2016-07-11: Version 1.2.5
26
+ - Fix: Chained `Logster::Logger` logger now receives backtrace as well.
27
+
28
+ - 2016-05-05: Version 1.2.4
29
+ - Fix: XSS in log message show if attacker can inject script into ENV
30
+
31
+ - 2016-05-05: Version 1.2.3
32
+ - Fix: clear_all now also clears rate limits
33
+ - Fix: protect against corrupt data in redis during clear
34
+
35
+ - 2016-03-22: Version 1.2.2
36
+ - Fix: Conflicting attributes and method name for `Logster::RedisStore#rate_limits`.
37
+ - Fix: Rate limit checker was tracking limits too early. It should only track when a message has been bumped or saved.
38
+
39
+ - 2016-03-22: Version 1.2.1
40
+ - Feature: Add method to retrieve current rate from rate limiters.
41
+ - Feature: Make `RedisStore#rate_limits` readable.
42
+ - Feature: Make `RedisRateLimiter#callback` and `RedisRateLimiter#duration` readable.
43
+
44
+ - 2016-03-18: Version 1.2.0
45
+ - Fix: Move Redis configuration into RedisStore.
46
+ - Feature: Allow `RedisStore#redis_prefix` to either be a String or a Proc.
47
+
48
+ - 2016-02-11: Version 1.1.1
49
+ - Feature: Error rate can now be tracked in one minute and one hour buckets.
50
+
51
+ - 2015-11-27: Version 1.0.1
52
+ - New assets and logster logo
53
+ - Added favicon
54
+ - Added title
55
+ - Use rails logger instead of invoking store
56
+
57
+ - 2015-08-18: Version 0.9.9
58
+ - This marks the largest release of Logster to date, it has been in production use for quite a while, hence the version bump.
59
+ - Feature: automatically group errors in production mode, can be manually controlled via Logster.config.allow_grouping
60
+ - Feature: automatically track application version, can be manually controlled via Logster.config.application_version
61
+ - Feature: Font Awesome icons used throughout
62
+ - Feature: Ember upgrade to 1.13
63
+ - Feature: you can now "solve" a class of errors, if error has an application_version and backtrace. Once an error is solved it will no longer be reported for the "solved" application_versions
64
+ - Feature: allow users to delete a single error
65
+ - UX: use table for env
66
+ - Feature: display "protected" state of message in list
67
+ - Feature: use local times as opposed to relative times in time column
68
+ - UX: use Google Roboto font as opposed to system fonts
69
+ - UX: remove pointless titles from log table
70
+ - Feature: If Logster is in a background tab only poll once every 60 seconds (as opposed to 3)
71
+ - Fix: protect/unprotect redirected to show page
72
+
73
+ - 2015-06-16: Version 0.8.3
74
+ - Chained loggers now respect chain ignore
75
+ - Add hostname and process_id to env on all messages
76
+
77
+ - 2015-06-10: Version 0.8.2
78
+ - Add hostname and process_id to env on all messages
79
+
80
+ - 2015-05-01: Version 0.8.1
81
+ - Don't crash out logging routine if redis is down or stderr is closed
82
+
83
+ - 2015-04-16: Version 0.8.0
84
+ - Improve formatting of /show page
85
+ - Big version bump cause it is quite stable
86
+
87
+ - 2015-02-27: Version 0.1.7
88
+ - Fix invalid request on ?test
89
+
90
+ - 2014-08-05: Version 0.1.3
91
+ - Automatically include ignore filter
92
+
93
+ - 2014-08-13: Version 0.1.6
94
+ - Simplify install process
95
+ - Fix crash on 404 in /logs dir
96
+
97
+ - 2014-08-10: Version 0.1.5
98
+ - Fix crash in Rails 3
99
+
100
+ - 2014-08-08: Version 0.1.4
101
+ - Fix crash in ignore filter
102
+
103
+ - 2014-07-17: Version 0.1.1
104
+ - Refactored report method into base_store.rb - will be easier to make a new log store
105
+ - Add link in UI to clear all (non-protected) logs
106
+ - Add example of submitting logs from Sidekiq jobs
107
+ - Show Protect/Share links on all tabs
108
+ - Render hashes provided via Logster.add_to_env
109
+
110
+ - 2014-07-04: Version 0.0.12
111
+ - Feature: Able to share logs, at /logs/show/(hexdigits)
112
+ - Add protecting logs, so they aren't deleted when old (for use with sharing)
113
+ - Restructured Redis data model
114
+
115
+ - 2014-05-24: Version 0.0.10
116
+ - Correct context for error reporting
117
+ - Clean up backtraces of reported exceptions
118
+
119
+ - 2014-05-13: Version 0.0.9
120
+ - Stray debugger message removed, add window.location logging to js
121
+
122
+ - 2014-05-13: Version 0.0.8
123
+ - Fix pacakging binstubs by mistake
124
+
125
+ - 2014-05-13: Version 0.0.7
126
+ - Add support for javascript exception logging
127
+
128
+ - 2014-05-12: Version 0.0.6
129
+ - Add referer to env
130
+
131
+ - 2014-05-12: Version 0.0.5
132
+ - Feature: We now log basic rack environment with the messages
133
+ - Add your own with Logster.add_to_env(env, key, value)
134
+
135
+ - 2014-05-07: Version 0.0.4
136
+ - Feature: Ability to ignore patterns with Logster.store.ignore = [/regex/]
137
+ - Feature: Store backtraces, allow people to view them in the GUI
138
+
139
+ - 2014-05-07: Started changelog :)
140
+ - Report params in env tab
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in rack-log-viewer.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rack-log-viewer.gemspec
4
+ gemspec
data/Guardfile CHANGED
@@ -1,8 +1,8 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard :minitest do
5
- watch(%r{^test/(.*)\/?test_(.*)\.rb$})
6
- watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
7
- watch(%r{^test/test_helper\.rb$}) { 'test' }
8
- end
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :minitest do
5
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
6
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
7
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
8
+ end
@@ -1,22 +1,22 @@
1
- Copyright (c) 2014 Sam Saffron
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2014 Sam Saffron
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,99 +1,99 @@
1
- ![logster logo](https://raw.githubusercontent.com/discourse/logster/master/website/images/logo-logster-cropped-small.png)
2
-
3
- Logster is an embedded Ruby "exception reporting service" admins can view on live websites, at `http://example.com/logs`
4
-
5
- ## Interface
6
-
7
- ![Screenshot](https://raw.githubusercontent.com/discourse/logster/master/website/images/logster-screenshot.png)
8
-
9
- Play with a live demo at [logster.info/logs](http://logster.info/logs).
10
-
11
- ## Installation
12
-
13
- Add these lines to your application's Gemfile:
14
-
15
- gem 'redis'
16
- gem 'logster'
17
-
18
- And then execute:
19
-
20
- $ bundle
21
-
22
- Make logster web available add the following to your `routes.rb`:
23
-
24
- ```
25
- constraints lambda { |req| req.session["admin"] } do
26
- mount Logster::Web => "/logs"
27
- end
28
- ```
29
-
30
- By default, logster will only run in development and production environments.
31
-
32
- To run logster in other environments, in `config/application.rb`
33
-
34
- ```
35
- Logster.set_environments([:development, :staging, :production])
36
- ```
37
-
38
- ### Tracking Error Rate
39
- Logster allows you to register a callback when the rate of errors has exceeded
40
- a given limit.
41
-
42
- Tracking buckets available are one minute and an hour.
43
-
44
- Example:
45
- ```
46
- Logster.register_rate_limit_per_minute(Logger::WARN, 60) do |rate|
47
- puts "O no! The error rate is now #{rate} errors/min"
48
- end
49
-
50
- Logster.register_rate_limit_per_hour([Logger::WARN, Logger::ERROR, Logger::FATAL], 60) do |rate|
51
- puts "O no! The error rate is now #{rate} errors/hour"
52
- end
53
- ```
54
-
55
- ### Note
56
- If you are seeing the error `No such middleware to insert before: ActionDispatch::DebugExceptions` after installing logster,
57
- then you are using a conflicting gem like `better_errors` or `web-console`.
58
-
59
- To avoid this error, make sure logster is added behind those conflicting gems in your Gemfile.
60
-
61
- ### Mount using warden (devise)
62
- ```
63
- admin_constraint = lambda do |request|
64
- request.env['warden'].authenticate? and request.env['warden'].user.admin?
65
- end
66
-
67
- constraints admin_constraint do
68
- mount Logster::Web, at: "/logs"
69
- end
70
- ```
71
-
72
- Out of the box, logster will use the default redis connection, to customise, in `config/application.rb`
73
-
74
- ```
75
- Logster.store = Logster::RedisStore.new(redis_connection)
76
- ```
77
-
78
- ### Heroku Deployment
79
- In case you may be using the `rails_12factor` gem in a production deployment on Heroku, the standard `Rails.logger` will not cooperate properly with Logster. Extend Rails.logger in your `config/application.rb` or `config/initializers/logster.rb` with:
80
- ```
81
- if Rails.env.production?
82
- Rails.logger.extend(ActiveSupport::Logger.broadcast(Logster.logger))
83
- end
84
- ```
85
-
86
- ## Thanks
87
-
88
- Logster UI is built using [Ember.js](http://emberjs.com/)
89
-
90
- ## Contributing
91
-
92
- 1. Fork it ( https://github.com/discourse/logster/fork )
93
- 2. Create your feature branch (`git checkout -b my-new-feature`)
94
- 3. Run `cd client-app && npm install`
95
- 4. Run `rake client_dev` to start Sinatra server (port 9292) and Ember server (port 4200). Use Ember server for hot reload for client code.
96
- 5. Once you're done making changes, run `./build_client_app.sh` to make and copy a production build to the assets folder. (Shutting down the rake task will do this step automatically for you)
97
- 6. Commit your changes (`git commit -am 'Add some feature'`)
98
- 7. Push to the branch (`git push origin my-new-feature`)
99
- 8. Create a new Pull Request
1
+ ![logster logo](https://raw.githubusercontent.com/discourse/logster/master/website/images/logo-logster-cropped-small.png)
2
+
3
+ Logster is an embedded Ruby "exception reporting service" admins can view on live websites, at `http://example.com/logs`
4
+
5
+ ## Interface
6
+
7
+ ![Screenshot](https://raw.githubusercontent.com/discourse/logster/master/website/images/logster-screenshot.png)
8
+
9
+ Play with a live demo at [logster.info/logs](http://logster.info/logs).
10
+
11
+ ## Installation
12
+
13
+ Add these lines to your application's Gemfile:
14
+
15
+ gem 'redis'
16
+ gem 'logster'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Make logster web available add the following to your `routes.rb`:
23
+
24
+ ```
25
+ constraints lambda { |req| req.session["admin"] } do
26
+ mount Logster::Web => "/logs"
27
+ end
28
+ ```
29
+
30
+ By default, logster will only run in development and production environments.
31
+
32
+ To run logster in other environments, in `config/application.rb`
33
+
34
+ ```
35
+ Logster.set_environments([:development, :staging, :production])
36
+ ```
37
+
38
+ ### Tracking Error Rate
39
+ Logster allows you to register a callback when the rate of errors has exceeded
40
+ a given limit.
41
+
42
+ Tracking buckets available are one minute and an hour.
43
+
44
+ Example:
45
+ ```
46
+ Logster.register_rate_limit_per_minute(Logger::WARN, 60) do |rate|
47
+ puts "O no! The error rate is now #{rate} errors/min"
48
+ end
49
+
50
+ Logster.register_rate_limit_per_hour([Logger::WARN, Logger::ERROR, Logger::FATAL], 60) do |rate|
51
+ puts "O no! The error rate is now #{rate} errors/hour"
52
+ end
53
+ ```
54
+
55
+ ### Note
56
+ If you are seeing the error `No such middleware to insert before: ActionDispatch::DebugExceptions` after installing logster,
57
+ then you are using a conflicting gem like `better_errors` or `web-console`.
58
+
59
+ To avoid this error, make sure logster is added behind those conflicting gems in your Gemfile.
60
+
61
+ ### Mount using warden (devise)
62
+ ```
63
+ admin_constraint = lambda do |request|
64
+ request.env['warden'].authenticate? and request.env['warden'].user.admin?
65
+ end
66
+
67
+ constraints admin_constraint do
68
+ mount Logster::Web, at: "/logs"
69
+ end
70
+ ```
71
+
72
+ Out of the box, logster will use the default redis connection, to customise, in `config/application.rb`
73
+
74
+ ```
75
+ Logster.store = Logster::RedisStore.new(redis_connection)
76
+ ```
77
+
78
+ ### Heroku Deployment
79
+ In case you may be using the `rails_12factor` gem in a production deployment on Heroku, the standard `Rails.logger` will not cooperate properly with Logster. Extend Rails.logger in your `config/application.rb` or `config/initializers/logster.rb` with:
80
+ ```
81
+ if Rails.env.production?
82
+ Rails.logger.extend(ActiveSupport::Logger.broadcast(Logster.logger))
83
+ end
84
+ ```
85
+
86
+ ## Thanks
87
+
88
+ Logster UI is built using [Ember.js](http://emberjs.com/)
89
+
90
+ ## Contributing
91
+
92
+ 1. Fork it ( https://github.com/discourse/logster/fork )
93
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
94
+ 3. Run `cd client-app && npm install`
95
+ 4. Run `rake client_dev` to start Sinatra server (port 9292) and Ember server (port 4200). Use Ember server for hot reload for client code.
96
+ 5. Once you're done making changes, run `./build_client_app.sh` to make and copy a production build to the assets folder. (Shutting down the rake task will do this step automatically for you)
97
+ 6. Commit your changes (`git commit -am 'Add some feature'`)
98
+ 7. Push to the branch (`git push origin my-new-feature`)
99
+ 8. Create a new Pull Request