Re: [PHP] Adding a log file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Erik Osterman wrote:

Consider using this....

//
// STDERR logging function
//
function warn( $msg, $die = 0 )
{
$fp = fopen("php://stderr", 'w') or die("Failed to open STDERR");
fwrite($fp, "[".strftime("%Y-%m-%d %T")."] $msg\n") or die("Failed to write to stderr");
fclose($fp);
if($die)
die($msg);
}

There is also the error_log() and syslog() functions.


http://us2.php.net/error_log
http://us2.php.net/syslog

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux