Watch/read a growing log file

后端 未结 7 1071
春和景丽
春和景丽 2020-12-08 00:54

I have a log file that is constantly growing. How can I watch and parse it via a Ruby script?

The script will parse each new line as it is written to the file and ou

7条回答
  •  有刺的猬
    2020-12-08 01:57

    If you're on Linux...

    tail -f log/development.log | grep "ERROR"
    

    Unless you really wanted it to be a Ruby script for some reason.

提交回复
热议问题