PHP script on the server (apache)
I want to create my own custom logging script on my Apache2 web server. It has to execute on the server every (POST, GET, etc.) and then write some information to my database.
My problem: Now I cannot start the execution.
I searched (Google) for handlers in apache. "addHandler / setHandler" in apache2.conf. But they are simply executed if a special file is requested.
And placing the script on each of my pages isn't an option either. Just because I cannot fit the script into the requested image.
Is there any option in the config files to do something like:
onRequest var/www/html/customLog.php
I prefer .php
or .sh
. Thanks for the tip.
PS I am running my server on Linux.
source to share
The best way to do this is probably with CustomLog
, you can log whatever is described in custom log formats that should cover whatever you want to log , and pipe it to a program , which can be PHP or a wrapper script as you like, for login to the database.
source to share