{"id":18843740,"url":"https://github.com/fursich/exception_file_notifier","last_synced_at":"2025-11-11T19:15:29.123Z","repository":{"id":56848095,"uuid":"100956977","full_name":"fursich/exception_file_notifier","owner":"fursich","description":"json-formatted file logger for exception notification","archived":false,"fork":false,"pushed_at":"2020-12-26T12:27:57.000Z","size":23,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-07T16:59:23.229Z","etag":null,"topics":["exception-notification","monitoring","rack","rails","ruby-logger"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fursich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-21T13:50:37.000Z","updated_at":"2020-12-26T12:27:59.000Z","dependencies_parsed_at":"2022-09-07T03:10:52.428Z","dependency_job_id":null,"html_url":"https://github.com/fursich/exception_file_notifier","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fursich/exception_file_notifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fursich%2Fexception_file_notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fursich%2Fexception_file_notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fursich%2Fexception_file_notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fursich%2Fexception_file_notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fursich","download_url":"https://codeload.github.com/fursich/exception_file_notifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fursich%2Fexception_file_notifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283912507,"owners_count":26915587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exception-notification","monitoring","rack","rails","ruby-logger"],"created_at":"2024-11-08T02:58:45.225Z","updated_at":"2025-11-11T19:15:29.093Z","avatar_url":"https://github.com/fursich.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exception File Notifier\n\n[![Gem Version](https://badge.fury.io/rb/exception_file_notifier.svg)](https://badge.fury.io/rb/exception_file_notifier)\n[![Travis](https://api.travis-ci.org/fursich/exception_file_notifier.png)](http://travis-ci.org/fursich/exception_file_notifier)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\n**Exception File Notifier** is a custom notifier for [Exception Notification](https://github.com/smartinez87/exception_notification), that records notifications onto a log file when errors occur in a Rack/Rails application.\n\nAll the error logs are converted into JSON format. This would be useful typically when you wish to monitor an app with monitoring tools - e.g. Kibana + ElasticSearch + Fluentd, or anything alike.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'exception_file_notifier'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install exception_file_notifier\n\n## Usage\n\nSet proper configs in *config/initializers/exception_notification.rb*\n\nTo get started, use the simplest settings:\n\n```ruby:config/initializers/exception_notification.rb\nExceptionNotification.configure do |config|\n\n  config.add_notifier :file, {\n      filename:  \"#{Rails.root}/log/exceptions.log\"\n  }\n```\n\nThat works in all the environment (including test).\n\nYou could also customize settings like so:\n\n```ruby:config/initializers/exception_notification.rb\nExceptionNotification.configure do |config|\n\n# disable all the notifiers in certain environment\n  config.ignore_if do |exception, options|\n    Rails.env.test?\n  end\n\n  config.add_notifier :file, {\n      filename:  \"#{Rails.root}/log/exceptions_#{Rails.env}.log\",  # generate different log files depending on environments\n      shift_age: 'daily'     # use shift_age/shift_size options to rotate log files\n  }\n```\n\nYou could also pass as many original values as you like, which will be evaluated JSON-ified at the time when an exception occurs. For detailed setting you may wish to consult with the Exception Notification [original readme](https://github.com/smartinez87/exception_notification).\n\n#### available options:\n\n- filename:   specify the log file (preferablly with its absolute path)\n\n- shift_age:  option for log file rotation: directly passed to Ruby Logger\n\n- shift_size: option for log file rotation: directly passed to Ruby Logger\n\n(for the latter options see also: https://docs.ruby-lang.org/ja/latest/method/Logger/s/new.html)\n\n#### Note\n\nDue to [a bug](https://bugs.ruby-lang.org/issues/12948) with ruby Logger discovered in ruby 2.2 - 2.3, it might happen that you cannot rotate logs by using shift_age. (for those who come up with any workaround for this, please let us know / PR are welcomed)\n\nMeanwhile you could cope with either 1) upgrading your ruby version upto 2.4, or 2) rotate logs by size, not date\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/fursich/exception_file_notifier.\n\n## Special Thanks To\n\nAll the folks who have given supports, especially @motchang and @katsurak for great advises and reviews.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffursich%2Fexception_file_notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffursich%2Fexception_file_notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffursich%2Fexception_file_notifier/lists"}