Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- debugging server service code
April 12, 2008, 8:29 am
rate this thread
var_dump(), as they can print out all the variables you need and the
web browser can show any run time error message. But what if it is
either as an AJAX call or even more so, as an OpenSocial's service --
in those case, there is a bunch of parameters provided to the PHP file
and it is really hard to mimic a session using
http://www.oursite.com/getData.php?auth_token=3424242345 ... with
possible data posted to the PHP file.
In those situation, we can write any variable to a file using
var_export() and a write function as a debug log... but what if there
is any run time error... is there a way to redirect all those info
also to a file, or somehow be able to see the run time error and stack
Any possible solution? Thanks for your help!
Re: debugging server service code
You can set a log file in your php.ini file which will log php-detected
errors instead of displaying them.
I have it on on my development system, just so I can go back and look at
the errors if I need to. I just clean it up every few days (I make LOTS
of typing errors :-)= ).
It's also a good idea to have it on your production system and check it
on a regular basis to ensure there are no unexpected errors. I
generally have a cron job check the size and mail it to me of non-zero
on a daily basis, then rotate it with the rest of the log files.
Remove the "x" from my email address
JDS Computer Training Corp.