Skip to content
Advertisement

watchdog monitoring file for changes

I have a need to watch a log file for changes. After looking through stackoverflow questions, I see people recommending watchdog. So I’m trying to test, and am not sure where to add the code for when files change:

JavaScript

Where do I add the “got it” — in the while loop if the files have been added/changed?

Advertisement

Answer

Instead of LoggingEventHandler define your handler:

JavaScript

on_modified is called when a file or directory is modified.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement