I have a base controller that log errors and I want include in the log message ALL request data, ALL headers and request body. How can I do that in CodeIgniter?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CodeIgniter
$this->inputwhich is equivalent tofile_get_contents('php://input')contains all the Body request (if any) an output from foovar_dump($this->input)would look like:and for the headers laso you have the new command in PHP 5.4 which is
headers_list(). and also, many other data can be contained in the CI seesion like:ip_address, user_agent ,last_activity