Skip to content

Instantly share code, notes, and snippets.

@alexmchale
Created August 12, 2016 15:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmchale/acfd581995ff44a8a24b82938019a04e to your computer and use it in GitHub Desktop.
Save alexmchale/acfd581995ff44a8a24b82938019a04e to your computer and use it in GitHub Desktop.
php script to log incoming requests
<?php
$message = "Received Request at " . time() . "\n";
$message .= "------------------------------------------------------------------------\n";
$message .= "\n";
$message .= json_encode($_REQUEST, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT) . "\n";
$message .= "\n";
$message .= json_encode($_SERVER, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT) . "\n";
$message .= "\n";
$filename = "logger.txt";
file_put_contents("logger.txt", $message, FILE_APPEND);
echo "OK\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment