Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/kostya/eye-rotate
- Owner: kostya
- License: mit
- Created: 2014-05-31T18:41:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-12-15T05:09:48.000Z (almost 7 years ago)
- Last Synced: 2024-04-27T15:47:14.328Z (7 months ago)
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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
endEye.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"
endEye.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