logster 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -18
  3. data/.travis.yml +15 -15
  4. data/CHANGELOG.md +137 -130
  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 +81 -81
  21. data/assets/javascript/vendor.js +5302 -5302
  22. data/assets/stylesheets/client-app.css +0 -0
  23. data/assets/stylesheets/vendor.css +3 -3
  24. data/build_client_app.sh +12 -12
  25. data/client-app/.editorconfig +20 -20
  26. data/client-app/.ember-cli +9 -9
  27. data/client-app/.eslintignore +19 -19
  28. data/client-app/.eslintrc.js +46 -46
  29. data/client-app/.gitignore +23 -23
  30. data/client-app/.travis.yml +27 -27
  31. data/client-app/.watchmanconfig +3 -3
  32. data/client-app/README.md +57 -57
  33. data/client-app/app/app.js +14 -14
  34. data/client-app/app/components/message-info.js +18 -18
  35. data/client-app/app/components/message-row.js +45 -45
  36. data/client-app/app/components/panel-resizer.js +75 -75
  37. data/client-app/app/components/tab-contents.js +27 -27
  38. data/client-app/app/components/tab-link.js +5 -5
  39. data/client-app/app/components/tabbed-section.js +32 -32
  40. data/client-app/app/components/time-formatter.js +25 -25
  41. data/client-app/app/components/update-time.js +21 -21
  42. data/client-app/app/controllers/index.js +83 -83
  43. data/client-app/app/controllers/show.js +13 -13
  44. data/client-app/app/index.html +29 -29
  45. data/client-app/app/initializers/app-init.js +55 -55
  46. data/client-app/app/lib/preload.js +14 -14
  47. data/client-app/app/lib/utilities.js +140 -140
  48. data/client-app/app/models/message-collection.js +158 -158
  49. data/client-app/app/models/message.js +99 -99
  50. data/client-app/app/resolver.js +3 -3
  51. data/client-app/app/router.js +14 -14
  52. data/client-app/app/routes/index.js +53 -53
  53. data/client-app/app/routes/show.js +14 -14
  54. data/client-app/app/styles/app.css +387 -387
  55. data/client-app/app/templates/application.hbs +2 -2
  56. data/client-app/app/templates/components/message-info.hbs +44 -44
  57. data/client-app/app/templates/components/message-row.hbs +17 -17
  58. data/client-app/app/templates/components/tabbed-section.hbs +10 -10
  59. data/client-app/app/templates/components/time-formatter.hbs +1 -1
  60. data/client-app/app/templates/index.hbs +57 -57
  61. data/client-app/app/templates/show.hbs +4 -4
  62. data/client-app/config/environment.js +51 -51
  63. data/client-app/config/optional-features.json +3 -3
  64. data/client-app/config/targets.js +18 -18
  65. data/client-app/ember-cli-build.js +29 -29
  66. data/client-app/package-lock.json +11365 -11365
  67. data/client-app/package.json +56 -56
  68. data/client-app/testem.js +25 -25
  69. data/client-app/tests/index.html +34 -34
  70. data/client-app/tests/integration/components/message-info-test.js +26 -26
  71. data/client-app/tests/integration/components/message-row-test.js +26 -26
  72. data/client-app/tests/integration/components/panel-resizer-test.js +26 -26
  73. data/client-app/tests/integration/components/tab-contents-test.js +26 -26
  74. data/client-app/tests/integration/components/tab-link-test.js +26 -26
  75. data/client-app/tests/integration/components/tabbed-section-test.js +26 -26
  76. data/client-app/tests/integration/components/time-formatter-test.js +26 -26
  77. data/client-app/tests/integration/components/update-time-test.js +26 -26
  78. data/client-app/tests/test-helper.js +8 -8
  79. data/client-app/tests/unit/controllers/index-test.js +12 -12
  80. data/client-app/tests/unit/controllers/show-test.js +12 -12
  81. data/client-app/tests/unit/initializers/app-init-test.js +31 -31
  82. data/client-app/tests/unit/routes/index-test.js +11 -11
  83. data/client-app/tests/unit/routes/show-test.js +11 -11
  84. data/lib/examples/sidekiq_logster_reporter.rb +21 -21
  85. data/lib/logster.rb +54 -54
  86. data/lib/logster/base_store.rb +130 -130
  87. data/lib/logster/configuration.rb +25 -25
  88. data/lib/logster/ignore_pattern.rb +65 -65
  89. data/lib/logster/logger.rb +108 -102
  90. data/lib/logster/message.rb +227 -227
  91. data/lib/logster/middleware/debug_exceptions.rb +26 -26
  92. data/lib/logster/middleware/reporter.rb +56 -56
  93. data/lib/logster/middleware/viewer.rb +220 -220
  94. data/lib/logster/rails/railtie.rb +58 -58
  95. data/lib/logster/redis_store.rb +481 -481
  96. data/lib/logster/version.rb +3 -3
  97. data/lib/logster/web.rb +14 -14
  98. data/logster.gemspec +34 -34
  99. data/test/examples/test_sidekiq_reporter_example.rb +46 -46
  100. data/test/fake_data/Gemfile +4 -4
  101. data/test/fake_data/generate.rb +10 -10
  102. data/test/logster/middleware/test_reporter.rb +21 -21
  103. data/test/logster/middleware/test_viewer.rb +96 -96
  104. data/test/logster/test_base_store.rb +147 -147
  105. data/test/logster/test_ignore_pattern.rb +41 -41
  106. data/test/logster/test_logger.rb +80 -74
  107. data/test/logster/test_message.rb +34 -34
  108. data/test/logster/test_redis_rate_limiter.rb +230 -230
  109. data/test/logster/test_redis_store.rb +427 -427
  110. data/test/test_helper.rb +38 -38
  111. data/vendor/assets/javascripts/logster.js.erb +39 -39
  112. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3887d4bdf8b6d011a7b7bfa7bba21cc4533d93ba406cde574369b37133c5a9db
4
- data.tar.gz: '05826b82a6456994bc40f7e3a0d2b30f364d2ff2c44c40321b954099faf09892'
3
+ metadata.gz: 3e5e9decebe1a9a3e0d342200b5ece0d9447fd3bf7e27eb51ef34b26e1a1bbb9
4
+ data.tar.gz: 1a07e2040921e6dad703a03d43a1e8eb6394a24061237b6515b53e0a82cc0b99
5
5
  SHA512:
6
- metadata.gz: bdbd94be1ac4b314d6da8a90431046df9126b40b91197e8f3abfbb7533dc7b5738baec307ab7e4b5af92cea45f1af4a571eeb6d54aea20dcf7eefe43523d7f0a
7
- data.tar.gz: 5893c134d20d26a342f2c7161b5084ca3c939d37712f82ae7ba406d05da37f05ff46c17360462b4152ad27d359400399baf4eff71b9f4bd8f19eea166a9c71a6
6
+ metadata.gz: 7f4d6c0dc19e829e25a0e5b7df21661137a60a43b5e646f7160bfae4f0e58709a46890d49ad11576956af992dd6122a69dc67bf15305a5826df9c71439e3cbe8
7
+ data.tar.gz: 1ff7baa54f12266289573a6481860f1e193b3695d4287086e35416a1a630068a5d24cd7a232e1d2f4705fa892abc3a7d580994df27318a836ea2f8b6556f5559
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,130 +1,137 @@
1
- # CHANGELOG
2
-
3
- - 2018-08-13: Version 1.2.10
4
- - Feature: expose chained loggers in Logster::Logger
5
-
6
- - 2017-10-27: Version 1.2.8
7
- - Fix: `Logster::Middleware::DebugExceptions` is passed a request in Rails 5 instead of the env.
8
-
9
- - 2017-01-30: Version 1.2.7
10
- - Feature: Add override_level to Logster::Logger allowing for threadsafe logger override
11
-
12
- - 2016-10-24: Version 1.2.6
13
- - Fix: Check if `Rails.env` is defined when using Logster in a none Rails project.
14
-
15
- - 2016-07-11: Version 1.2.5
16
- - Fix: Chained `Logster::Logger` logger now receives backtrace as well.
17
-
18
- - 2016-05-05: Version 1.2.4
19
- - Fix: XSS in log message show if attacker can inject script into ENV
20
-
21
- - 2016-05-05: Version 1.2.3
22
- - Fix: clear_all now also clears rate limits
23
- - Fix: protect against corrupt data in redis during clear
24
-
25
- - 2016-03-22: Version 1.2.2
26
- - Fix: Conflicting attributes and method name for `Logster::RedisStore#rate_limits`.
27
- - Fix: Rate limit checker was tracking limits too early. It should only track when a message has been bumped or saved.
28
-
29
- - 2016-03-22: Version 1.2.1
30
- - Feature: Add method to retrieve current rate from rate limiters.
31
- - Feature: Make `RedisStore#rate_limits` readable.
32
- - Feature: Make `RedisRateLimiter#callback` and `RedisRateLimiter#duration` readable.
33
-
34
- - 2016-03-18: Version 1.2.0
35
- - Fix: Move Redis configuration into RedisStore.
36
- - Feature: Allow `RedisStore#redis_prefix` to either be a String or a Proc.
37
-
38
- - 2016-02-11: Version 1.1.1
39
- - Feature: Error rate can now be tracked in one minute and one hour buckets.
40
-
41
- - 2015-11-27: Version 1.0.1
42
- - New assets and logster logo
43
- - Added favicon
44
- - Added title
45
- - Use rails logger instead of invoking store
46
-
47
- - 2015-08-18: Version 0.9.9
48
- - This marks the largest release of Logster to date, it has been in production use for quite a while, hence the version bump.
49
- - Feature: automatically group errors in production mode, can be manually controlled via Logster.config.allow_grouping
50
- - Feature: automatically track application version, can be manually controlled via Logster.config.application_version
51
- - Feature: Font Awesome icons used throughout
52
- - Feature: Ember upgrade to 1.13
53
- - 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
54
- - Feature: allow users to delete a single error
55
- - UX: use table for env
56
- - Feature: display "protected" state of message in list
57
- - Feature: use local times as opposed to relative times in time column
58
- - UX: use Google Roboto font as opposed to system fonts
59
- - UX: remove pointless titles from log table
60
- - Feature: If Logster is in a background tab only poll once every 60 seconds (as opposed to 3)
61
- - Fix: protect/unprotect redirected to show page
62
-
63
- - 2015-06-16: Version 0.8.3
64
- - Chained loggers now respect chain ignore
65
- - Add hostname and process_id to env on all messages
66
-
67
- - 2015-06-10: Version 0.8.2
68
- - Add hostname and process_id to env on all messages
69
-
70
- - 2015-05-01: Version 0.8.1
71
- - Don't crash out logging routine if redis is down or stderr is closed
72
-
73
- - 2015-04-16: Version 0.8.0
74
- - Improve formatting of /show page
75
- - Big version bump cause it is quite stable
76
-
77
- - 2015-02-27: Version 0.1.7
78
- - Fix invalid request on ?test
79
-
80
- - 2014-08-05: Version 0.1.3
81
- - Automatically include ignore filter
82
-
83
- - 2014-08-13: Version 0.1.6
84
- - Simplify install process
85
- - Fix crash on 404 in /logs dir
86
-
87
- - 2014-08-10: Version 0.1.5
88
- - Fix crash in Rails 3
89
-
90
- - 2014-08-08: Version 0.1.4
91
- - Fix crash in ignore filter
92
-
93
- - 2014-07-17: Version 0.1.1
94
- - Refactored report method into base_store.rb - will be easier to make a new log store
95
- - Add link in UI to clear all (non-protected) logs
96
- - Add example of submitting logs from Sidekiq jobs
97
- - Show Protect/Share links on all tabs
98
- - Render hashes provided via Logster.add_to_env
99
-
100
- - 2014-07-04: Version 0.0.12
101
- - Feature: Able to share logs, at /logs/show/(hexdigits)
102
- - Add protecting logs, so they aren't deleted when old (for use with sharing)
103
- - Restructured Redis data model
104
-
105
- - 2014-05-24: Version 0.0.10
106
- - Correct context for error reporting
107
- - Clean up backtraces of reported exceptions
108
-
109
- - 2014-05-13: Version 0.0.9
110
- - Stray debugger message removed, add window.location logging to js
111
-
112
- - 2014-05-13: Version 0.0.8
113
- - Fix pacakging binstubs by mistake
114
-
115
- - 2014-05-13: Version 0.0.7
116
- - Add support for javascript exception logging
117
-
118
- - 2014-05-12: Version 0.0.6
119
- - Add referer to env
120
-
121
- - 2014-05-12: Version 0.0.5
122
- - Feature: We now log basic rack environment with the messages
123
- - Add your own with Logster.add_to_env(env, key, value)
124
-
125
- - 2014-05-07: Version 0.0.4
126
- - Feature: Ability to ignore patterns with Logster.store.ignore = [/regex/]
127
- - Feature: Store backtraces, allow people to view them in the GUI
128
-
129
- - 2014-05-07: Started changelog :)
130
- - Report params in env tab
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
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