Skip to content
Log rotate for the Eye gem.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
lib
spec
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
eye-rotate.gemspec

README.md

Eye::Rotate

Log rotate for the 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:

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:

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
You can’t perform that action at this time.