|
24 | 24 | </a> |
25 | 25 | </p> |
26 | 26 |
|
27 | | - |
28 | 27 | Solid Errors is a DB-based, app-internal exception tracker for Rails applications, designed with simplicity and performance in mind. It uses the new [Rails error reporting API](https://guides.rubyonrails.org/error_reporting.html) to store uncaught exceptions in the database, and provides a simple UI for viewing and managing exceptions. |
29 | 28 |
|
30 | | -> [!WARNING] |
31 | | -> The current point release of Rails (7.1.3.2) has a bug which severely limits the utility of Solid Errors. Exceptions raised during a web request *are not* reported to Rails' error reporter. There is a fix in the `main` branch, but it has not been released in a new point release. As such, Solid Errors is **not** production-ready unless you are running Rails from the `main` branch or until a new point version is released and you upgrade. |
32 | | -> The original bug report can be found [here](https://github.com/rails/rails/issues/51002) and the pull request making the fix is [here](https://github.com/rails/rails/pull/51050). I will try to backport the fix into the gem directly, but I haven't quite figured it out yet. |
33 | | -
|
34 | 29 |
|
35 | 30 | ## Installation |
36 | 31 |
|
@@ -173,6 +168,7 @@ You can configure Solid Errors via the Rails configuration object, under the `so |
173 | 168 | * `email_to` - The email address(es) to send a notification to. See [Email notifications](#email-notifications) for more information. |
174 | 169 | * `email_subject_prefix` - Prefix added to the subject line for email notifications. See [Email notifications](#email-notifications) for more information. |
175 | 170 | * `base_controller_class` - Specify a different controller as the base class for the Solid Errors controller. See [Authentication](#authentication) for more information. |
| 171 | +* `destroy_after` - If set, Solid Errors will periodically destroy resolved records that are older than the value specified. See [Automatically destroying old records](#automatically-destroying-old-records) for more information. |
176 | 172 |
|
177 | 173 | ### Database Configuration |
178 | 174 |
|
@@ -264,6 +260,20 @@ If you have set `send_emails` to `true` and have set an `email_to` address, Soli |
264 | 260 |
|
265 | 261 | If you have not set `send_emails` to `true` or have not set an `email_to` address, Solid Errors will not send any email notifications. |
266 | 262 |
|
| 263 | +#### Automatically destroying old records |
| 264 | + |
| 265 | +Setting `destroy_after` to a duration will allow Solid Errors to be self-maintaining by peridically destroying **resolved** records that are older than that value. The value provided must respond to `.ago`. |
| 266 | + |
| 267 | +```ruby |
| 268 | +# Automatically destroy records older than 30 days |
| 269 | +config.solid_errors.destroy_after = 30.days |
| 270 | +``` |
| 271 | + |
| 272 | +```ruby |
| 273 | +# Automatically destroy records older than 6 months |
| 274 | +config.solid_errors.destroy_after = 6.months |
| 275 | +``` |
| 276 | + |
267 | 277 | ### Examples |
268 | 278 |
|
269 | 279 | There are only two screens in the dashboard. |
@@ -359,7 +369,7 @@ You can always take control of the views by creating your own views and/or parti |
359 | 369 |
|
360 | 370 | ## Development |
361 | 371 |
|
362 | | -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. |
| 372 | +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. If you want to set up a local development database, run `rake db:migrate`. |
363 | 373 |
|
364 | 374 | To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). |
365 | 375 |
|
|
0 commit comments