open("| tail -0 -f #{log_file}") do |log| while active line = log.gets LOGGER.info(line) if line active = false if alive sleep(0.5) end end