Sha256: cf51b13bb49aa5ab9b9bf1a605d557979488b4b279b80b3177ed1b9c45fb9cb6

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

# RailsLogParser

This gem helps you to quick analyse your server logs without external monitor servers. Simple applications with a low number of requests cause only a low number of errors. So you can call a cronjob to analyse your logs periodly. If the summary is not empty your server will email you the result automaticly.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'rails_log_parser'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install rails_log_parser

## Usage

Sets your server log path:

```ruby
RailsLogParser::Parser.log_path = Rails.root.join('log/production.log')
```

Call the rake tasks in cronjobs:

```
LOG_PATH=/srv/rails/log/production.log
0,20,40 * * * * rake rails_log_parser:parse[22]' # summary of the last 22 minutes
```

Or use it in your code:

```ruby
parser = RailsLogParser::Parser.from_file(log_path)
puts parser.actions.select(&:fatal?).map(&:headline)
```

## Changelog

### 0.0.2

* Adding `ActionController::InvalidAuthenticityToken` as known exceptions

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Lichtbit/rails_log_parser.


## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_log_parser-0.0.2 README.md