inotify is a Linux kernel subsystem that informs processes when files are accessed/created/modified or deleted.
The primary purpose of inotify is to prevent processes from regularly scanning file systems for changes which may be costly and have undesirable lags.
There is a command line interface and bindings exist for several languages including python, java, ruby, haskell, PHP.
To debug inotify related issues, you can log the actual events triggered by the inotifywatch tool. (part of the inotify-tools.)