0

I did do a search first but havent found the desired solution yet!

Scenario - So I have a log4j logfile that gets hundreds of lines every minute. I am not allowed to add a DB Appender to the config due to various reasons and must read the file every few seconds and load to our MySQL database.

Is there any utility/code that only gets the changed records (almost like "tail -f") and using Python push the change to MySQL table? We need the record pushed to database in near-realtime (no more than 30 seconds delay 24-7).

I do not want to write something from scratch if possible and it needs to be a light weight solution. Daily log file gets to around 100 MB so I cannot do a full file push every few seconds either.

Any pointers would be appreciated!

JackFrost
  • 11
  • 4
  • You might find https://stackoverflow.com/questions/1703640/how-to-implement-a-pythonic-equivalent-of-tail-f worth reading – Bill Karwin Dec 01 '21 at 19:08

0 Answers0