Welcome Guest, Not a member yet? Register   Sign In
Poll: Improved error logging?
You do not have permission to vote in this poll.
yes
72.73%
24 72.73%
no
15.15%
5 15.15%
maybe
12.12%
4 12.12%
Total 33 vote(s) 100%
* You voted for this item. [Show Results]

Improve Error Logging
#2

Naaah, I would create a wrapper class (library/plugin) for that and not extend the framework with this functionality. In my opinion, functionality should not be in a framework, well as little as possible. Just keep the framework lean and mean. Everybody has got his own requirements for the log, so ...

And doing it yourself is quite simple. Some quick (and dirty) code:

1.

PHP Code:
function mail_error($errno$errstr$errfile$errline) {
 
 $message "[Error $errno$errstr - Error on line $errline in file $errfile";
 
 error_log($message); // writes the error to the log file
 
 mail('[email protected]''I have an error'$message);
}
set_error_handler('mail_error'E_ALL^E_NOTICE); 

2.

PHP Code:
echo $_SERVER['REQUEST_URI']; 

3.

PHP Code:
var_dump($_POST);
var_dump($_GET);
var_dump($_SESSION); 

of gewoon

PHP Code:
var_dump($_REQUEST); 

4.

PHP Code:
echo $_SERVER['REMOTE_ADDR']; 

Zelf zou ik vragen om een stack dump, maar ook dat is simpel:

PHP Code:
debug_backtrace(); 
Reply


Messages In This Thread
Improve Error Logging - by GeorgeD - 04-07-2015, 01:28 AM
RE: Improve Error Logging - by RWCH - 04-07-2015, 05:48 AM
RE: Improve Error Logging - by GeorgeD - 04-07-2015, 07:12 AM
RE: Improve Error Logging - by dmyers - 04-07-2015, 10:17 AM
RE: Improve Error Logging - by albertleao - 04-08-2015, 09:13 AM
RE: Improve Error Logging - by Razican - 04-19-2015, 03:15 PM
RE: Improve Error Logging - by fuxu - 04-09-2015, 12:43 AM
RE: Improve Error Logging - by mwhitney - 04-13-2015, 10:15 AM
RE: Improve Error Logging - by curunoir - 04-20-2015, 03:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB