Re: Trapping and masking errors
| From: | TorrentUK | Date: | Mon, 03 Dec 2001 18:53:14 +0000 |
| Subject: | Re: Trapping and masking errors | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14777@lists.php.net to get a copy of this message | ||
Yeah, I did look at the manual page, that was how I got the error_log()
function working. What I couldn't work out though was how to get the php
errors into the log. At the moment I use the error_log() to log some of my
scripts variables to an error.txt file. I also couldn't see a way of
preventing the php errors from appearing in the broswer window.
I'll take a look at the ob_start and ob_end_clean though,thanks.
-torrent
"Yasuo Ohgaki" <yasuo_ohgaki@yahoo.com> wrote in message
news:3C0B2289.70005@yahoo.com...
> Torrentuk wrote:
>
> > Hi,
> > I have written a simple form emailer for my site. In it I check to see
if
> > the mail was sent successfully and if not I write some variables to an
error
> > log. My question is, I would also like to write any php errors to the
log
> > file, e.g.
> >
> > Warning: Failed to Connect in
d:\WWW\htdocs/RND_ski-info-online/contact.php
> > on line 152
> >
> > how would I specify them in error_log()? Also how can I mask them from
> > appearing in the visitor's browser window so that I can just write my
> > "friendlier" error message there.
> >
> > Anyone hints, tips or just downright solutions would be greatly
appreciated
> > :)
> > -torrent
>
> How about take a look at the manual page?
> http://www.php.net/manual/en/ref.errorfunc.php
>
> You may also be interested in output buffering.
> Look for ob_start(), ob_end_clean(), etc.
>
> --
> Yasuo Ohgaki
>