Smartest way to monitor log-files in realtime?

我的未来我决定 提交于 2019-12-24 17:42:32

问题


I need to write a realtime monitoring application, which stores information from log-files into a gridview. + that they can be process further from other features/functions in my application.

I've running a Application on my server, which creates entries into a logfile at odd times. (csv-formatted)
These files can sometimes have up to 100mbs. I don't always want to scan/examine the whole file, because I know that new etries will always be added to the bottom of the file.

How should I construct the update-function (in my realtime monitoring application)?

  • Should I compare the filesize, and if the filesize has changed? -> examine/update
  • Should I examine the files every 1minute?
  • Should I check for "Date-modified"?

By the way, a full scan is time-consuming, can this be reduced by only scanning for new entries?

So my question is: What is the best way to solve it?!


回答1:


I use baretail. It works well constantly updating, and as long as your logs have meaningful statements in them, you can easily track the changes that are occurring.



来源:https://stackoverflow.com/questions/17090428/smartest-way-to-monitor-log-files-in-realtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!