error logs/logs in general
| From: | Prince | Date: | Mon, 21 Apr 2003 14:21:48 +0000 |
| Subject: | error logs/logs in general | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-144636@lists.php.net to get a copy of this message | ||
when writing error logs or just logs in general is it better to put the log
file entry inside the function that is doing the work or should they be put
somewhere else? like:
class db {
connect() {
include("db");
$date=date("M-d-Y");
$connect=mysql_connect($host, $mysqluser, $mysqlpwd);
if($connect==0){
$error=mysql_error();
die(error_log("$error while trying to connect to $db on $date", 3,
"error.log"));
//valid statement above??
} else {
mysql_select_db($db)||
die(error_log("mysql_error(); on $date failed:: connect died", 3,
"error.log"));
}}}
or should they be put elsewhere like in a class/function of their own..