In case you need to log something in a concrete PHP script you can do something as follows:
$queryString=$_SERVER['QUERY_STRING'];
$userIP = $_SERVER['REMOTE_ADDR'];
$myfile = fopen("my_log.txt", "a") or die("Unable to open file!");
$txt = $queryString;
fwrite($myfile, "\n".date("Y-m-d h:i:sa")." - ".$queryString." - ".$userIP);
fclose($myfile);
Like that we can log from what IP visits are coming and the query string coming in the request.
Here you can find tips and solutions about different technnologies such as Java, Spring, Kubernetes, Databases... based on my experience working on several software projects.
Friday, November 13, 2015
Sunday, November 1, 2015
Change keyword configuration spanish Linux / Cambiar configuracion teclado Linux
sudo setxkbmap -layout 'es,es' -model pc105
Subscribe to:
Posts (Atom)