#317 [Opn->Csd]: Error in /manual/en/package.logging.log.examples.php

From: Date: Thu, 05 Feb 2004 20:06:08 +0000
Subject: #317 [Opn->Csd]: Error in /manual/en/package.logging.log.examples.php
References: 1  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-2429@lists.php.net to get a copy of this message
ID: 317 Updated by: gurugeek@php.net Reported By: platter at earthlink dot net -Status: Open +Status: Closed Bug Type: Documentation Operating System: N/A PHP Version: 4.3.3 New Comment: Hello, Example 28-1 is accurate. In your code you specify a different path for the logfile. As such the output will be saved in the path you defined within your script. user.log is meant to be an example. Best Regards David Costa Previous Comments: ------------------------------------------------------------------------ [2004-02-05 15:00:49] negora at dotgeek dot org Dear platter, I think you misread the example text. What it says is "in the following example code". That is, for THAT specific code, the output file was user.log. In order for what you say to be a bug, the SAME EXACT CODE would have to be used, and in case it would log to another file than /tmp/user.log, THAT would be a bug. In your example, you changed the configuration of the log object, so the result is the one expected. Hope this clears it up for you. ------------------------------------------------------------------------ [2003-11-27 14:36:37] platter at earthlink dot net Description: ------------ Example 28-1 says that the messages will be written into the file user.log, when they actually will be written into /tmp/out1.log Reproduce code: --------------- <?php require_once 'Log.php'; $conf = array('mode' => 0600, 'timeFormat' => '%X %x'); $log = &Log::singleton('file', '/tmp/out1.log', 'test1', $conf, LOG_INFO); for ($i = 0; $i < 12; $i++) { $log->log("Foo: $i", LOG_INFO); } $log->close(); ?> Expected result: ---------------- Output to user.log (per the docs) Actual result: -------------- output to /tmp/out1.log (per the code) ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=317&edit=1

« previous php.pear.doc (#2429) next »