#317 [Com]: Error in /manual/en/package.logging.log.examples.php
| From: | php at cipri dot com | Date: | Thu, 05 Feb 2004 20:25:03 +0000 |
| Subject: | #317 [Com]: Error in /manual/en/package.logging.log.examples.php | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-2430@lists.php.net to get a copy of this message | ||
ID: 317
Comment by: php at cipri dot com
Reported By: platter at earthlink dot net
Status: Closed
Bug Type: Documentation
Operating System: N/A
PHP Version: 4.3.3
New Comment:
There actually /was/ a bug. 2 months ago atleast.
As you can see here[1] the bug was fixed in CVS on Sunday, yet too late
to be included in the doc rebuilt. Next sunday it was fixed when the
docs regenerated.
It's just taken this long for the bug to be closed.
[1]
http://cvs.php.net/diff.php/peardoc/en/package/logging/log/examples.xml?login=2&r1=1.2&r2=1.3&ty=h
Previous Comments:
------------------------------------------------------------------------
[2004-02-05 15:06:08] gurugeek@php.net
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
------------------------------------------------------------------------
[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