in reply to How do I catch the event in the Apache Server real time?
On the other hand, if you just want to be notified when the access log is updated, you might try something like:
See also perldoc -f seekopen LOG,"</var/log/httpd/access_log" or die "Cannot open log file: $! +"; seek LOG,0,2; # set to eof while (1) { while (<LOG>) { print; # or do something else... } sleep 1; # this is 1 seconds, so not exactly realtime seek(LOG, 0, 1); # reset eof flag }
|
|---|