Project

eye-rotate

0.0
No commit activity in last 3 years
No release in over 3 years
Rotate logs for eye gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0

Runtime

>= 0.6.1
 Project Readme

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