Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kostya/eye-rotate

Log rotate for the Eye gem.
https://github.com/kostya/eye-rotate

Last synced: 4 days ago
JSON representation

Log rotate for the Eye gem.

Awesome Lists containing this project

README

        

Eye::Rotate
---------

Log rotate for the [Eye](http://github.com/kostya/eye) gem.

## Installation

gem install eye
gem install eye-rotate

## Usage

Options:

:min_size (Fixnum) - set minimal file size for rotate
:gzip (Boolean) - gzip file or not
:count (Fixnum) - count of rotated files
:every (Fixnum) - how often rotate log (rotate every tick unless min_size set)
:filename (String) - use custom filename to rotate
:device (Symbol) - log from process settings [:stdout, :stderr, :stdall] (default: :stdall)

Example config: Auto rotate all processes stdall:

```ruby
require 'eye-rotate'

Eye.config do
log_rotate :every => 3.seconds, :count => 5, :gzip => true
end

Eye.application :app do
process :process do
start_command "ruby -e '1000.times { puts Time.now; $stdout.flush; sleep 0.1 } '"
daemonize true
pid_file "/tmp/1.pid"
stdall "/tmp/test.log"
end
end
```

Example config: Manually rotate:

```ruby
require 'eye-rotate'

Eye.config do
logger "/tmp/eye.log"
end

Eye.application :app do
process :process do
start_command "ruby -e 'loop { puts Time.now; $stdout.flush; sleep 0.1 } '"
daemonize true
pid_file "/tmp/1.pid"
stdall "/tmp/1.log"
check :log_rotate, :every => 30.seconds, :count => 5, :gzip => true
end
end
```

Run:

bundle exec eye l examples/manual.eye