[UPHPU] logging to a file

Orson Jones orson.uphpu at bookstore.usu.edu
Tue Jan 2 11:01:04 MST 2007


The reason I am asking this is because the hosting company doesn't like you logging to the database and doesn't provide a good way to get their log files.

> On 12/30/06, Orson Jones <orson.uphpu at bookstore.usu.edu> wrote:
> >
> > I was wondering about doing some logging to a file in an application I am
> > building.
> >
> > I am wondering if there are hidden problems with doing something like the
> > following. (Particularly with simultaneous attempts.)
> >
> > $fp = fopen("data.txt", "a");
> > $fputs($fp, $data);
> > fclose($fp);
> >
> > Are there more reliable ways of doing this, or is it sufficient?
> 
> 
> When I need this I use syslog.  You have to use openlog (and closelog) but
> it even works under Windows.  Although, as usual Windows makes you jump
> through fiery hoops to read the log.
> 
> -- 
> Scott Hill



More information about the UPHPU mailing list