kostya / eye

Process monitoring tool. Inspired from Bluepill and God.
MIT License
1.19k stars 89 forks source link

Eye log stdout took long time to flush to file. #238

Open emanzx opened 4 years ago

emanzx commented 4 years ago

I have notice some of my daemon that is daemonize by eye are not emitting log directly to file. is there a buffering happen and can I change that.

Here are my eye config.

require 'eye-http'

Eye.config do
  http :enable => true, :host => "127.0.0.1", :port => 12345
  logger '/var/log/dnsvault/eye/eye.log'
end

Eye.application 'services' do
  check :cpu, every: 10.seconds, below: 100, times: 3 # global check for all processes

    working_dir "/root/"
    stdall "/var/log/dnsvault/eye/trash.log" # stdout,err logs for processes by default
    env 'APP_ENV' => 'development' # global env for each processes
    trigger :flapping, times: 10, within: 1.minute, retry_in: 10.minutes
    chain grace: 10.seconds # chained start-restart with 10s interval, one by one.
    process :bindquerycollector do
       env 'HOME' => "/usr/home/system"
       working_dir "/usr/home/system/dnsvault/sbin"
       uid "system"
       gid "system"
       pid_file "/tmp/bindquerycollector.pid"
       start_command "/usr/home/system/dnsvault/sbin/bindquerycollector"
       stdall "/var/log/dnsvault/eye/bindquerycollector.log"
       stop_signals [:INT, 5.seconds, :QUIT, 2.second, :KILL]
       start_timeout 60.seconds
       daemonize true
    end
end
 eye -v
Eye v0.10.0 (c) 2012-2017 @kostya