Last active
April 28, 2016 14:50
-
-
Save tiagopassinato/97628aae6ee973b21e74c1fbafd999ef to your computer and use it in GitHub Desktop.
This little script logs all requests to a text file. (Useful for Restler and other scripts)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Logs all requests (Post, Json, etc.) | |
*/ | |
$logFile = '../logs/flow.log'; | |
$postdata = $_SERVER['REQUEST_URI']."\n".file_get_contents('php://input'); | |
if($_POST) | |
$postdata.="\nPOST:\n".print_r($_POST,true)." \n"; | |
if($_FILES) | |
$postdata.="FILES:\n".print_r($_FILES,true); | |
file_put_contents($logFile, $postdata."\n\n", FILE_APPEND); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment