Re: Re: Exposing PHP/errors on production vs. dev
| From: | Robert Cummings | Date: | Sat, 02 Aug 2008 17:40:47 +0000 |
| Subject: | Re: Re: Exposing PHP/errors on production vs. dev | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277627@lists.php.net to get a copy of this message | ||
On Sat, 2008-08-02 at 13:34 -0400, Daniel Brown wrote:
> On Sat, Aug 2, 2008 at 12:52 PM, Al <news@ridersite.org> wrote:
> > Here' the snippet I use on all my code files. Default is create and add to
> > error log file on the current dir.
> >
> > I generally echo $error_reporting to remind myself that the error reporting
> > is active.
> >
> > if(true) // TRUE for debug only
> > {
> > ini_set("display_errors", "on"); //use off if users will see
> > them
> > error_reporting(E_ALL);
> >
> > $error_reporting = '<span style="color:red">Error display and
> > logging
> > on</span> ';
> > }
>
> Quit top-posting, Al, or we'll feed you to the sheep. ;-P
>
> I do a similar thing, but with on-the-fly error display for
> debugging. Using sessions, only those with a developer flag see any
> errors. The rest are handled in logs (and yes, using E_ALL).
>
> One of my systems uses ~E_CUMMINGS though, because it reports
> things too violently.
Hmmpf!
--
http://www.interjinn.com
Application and Templating Framework for PHP