Parse Time Log file not set - causing error message
Hi all,
I have 2 error messages:
1) in my shop, just above the footer:
Warning: error_log(/var/log/www/zen/page_parse_time.log): failed to open stream: No such file or directory in /home/content/i/n/e/XXXX/html/shop/includes/modules/footer.php on line 39
Here is line 37-39 from my footer:
if (STORE_PAGE_PARSE_TIME == 'true') {
error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . $_SERVER['REQUEST_URI'] . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
2) in my shop manager index.php:
Warning: error_log(/var/log/www/zen/page_parse_time.log): failed to open stream: No such file or directory in /home/content/i/n/e/XXXX/html/shop/YYYY/includes/classes/logger.php on line 60
How can I fix this?
Thanks,
Goshawk
Below is the code from my logger.php:
class logger {
var $timer_start, $timer_stop, $timer_total;
// class constructor
function logger() {
$this->timer_start();
}
<<<<<<<this is line 60 (empty line)>>>>>
function timer_start() {
if (defined("PAGE_PARSE_START_TIME")) {
$this->timer_start = PAGE_PARSE_START_TIME;
} else {
$this->timer_start = microtime();
}
}
function timer_stop($display = 'false') {
$this->timer_stop = microtime();
$time_start = explode(' ', $this->timer_start);
$time_end = explode(' ', $this->timer_stop);
$this->timer_total = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
$this->write($_SERVER['REQUEST_URI'], $this->timer_total . 's');
if ($display == 'true') {
return $this->timer_display();
}
}
function timer_display() {
return '<span class="smallText">Parse Time: ' . $this->timer_total . 's</span>';
}
function write($message, $type) {
error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
}
}
?>
Time is but an illusion, there is only "now"!
Bookmarks