Bug #17356 [Csd]: Composite bug
| From: | leo at aprenderjapones dot com | Date: | Fri, 28 May 2010 19:23:52 +0000 |
| Subject: | Bug #17356 [Csd]: Composite bug | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-3817@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=17356&edit=1
ID: 17356
Updated by: leo@aprenderjapones.com
Reported By: leo at aprenderjapones dot com
Summary: Composite bug
Status: Closed
Type: Bug
Package: Log
Package Version: 1.12.0
PHP Version: 5.3.2
Assigned To: jon
Roadmap Versions:
New Comment:
Hello,
Just to let you know that the new version works perfectly, the warning
didn't appear anymore.
Regards.
Leonardo Sasso
Previous Comments:
------------------------------------------------------------------------
[2010-05-28 17:56:37] jon
-Status: Feedback
+Status: Closed
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download
at
http://pear.php.net/get/
------------------------------------------------------------------------
[2010-05-05 06:12:37] jon
I'm still not succeeding in reproducing this. Perhaps it's a
platform-specific issue? I'm using Mac OSX.
Could you try debugging this issue a bit more? The relevant code is in
Log::_getBacktraceVars().
------------------------------------------------------------------------
[2010-05-03 16:51:04] sassol
Hello,
in fact is not a critical error, it's a PHP notice, if you set the
error reporting like this:
error_reporting(E_ALL);
just before the code, you should get the notice as I do. Hiding the
notice error reporting with:
error_reporting(E_ALL ^ E_NOTICE);
will hide the error, but better fixing it than hiding it ;)
Leonardo
------------------------------------------------------------------------
[2010-05-02 19:39:23] jon
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: jon
I'm afraid I haven't been able to reproduce this. I've "simplified"
your script to this:
$log_conf1 = array('lineFormat' => '%{timestamp} [%{priority}]
%{message} file:%{file}');
$log_conf2 = array('lineFormat' => '%{timestamp} [%{priority}]
%{message}');
$logger_file1 = &Log::singleton('file', 'general1.log', '',
$log_conf1,
PEAR_LOG_DEBUG);
$logger_file2 = &Log::singleton('file', 'general2.log', '',
$log_conf2,
PEAR_LOG_DEBUG);
$logger_composite = &Log::singleton('composite');
$logger_composite->addChild($logger_file1);
$logger_composite->addChild($logger_file2);
$logger_composite->log('This event will be logged to both handlers.');
... and it runs just fine without errors.
------------------------------------------------------------------------
[2010-04-29 17:34:05] sassol
Description:
------------
When using composite file log, you can't use %{file}, %{line} or
%{function} in lineFormat
Test script:
---------------
$log_conf1 = array('lineFormat' => '%{timestamp} [%{priority}]
%{message} file:%{file}');
$log_conf2 = array('lineFormat' => '%{timestamp} [%{priority}]
%{message}');
$logger_file1 = &Log::singleton('file', __LOG_PATH . '/general1.log',
'', $log_conf1, DEVELOPMENT_ENVIRONMENT ? PEAR_LOG_DEBUG :
PEAR_LOG_WARNING);
$logger_file2 = &Log::singleton('file', __LOG_PATH . '/general2.log',
'', $log_conf2, DEVELOPMENT_ENVIRONMENT ? PEAR_LOG_DEBUG :
PEAR_LOG_WARNING);
$logger_composite = &Log::singleton('composite');
$logger_composite->addChild($logger_file1);
$logger_composite->addChild($logger_file2);
$logger_composite->log('This event will be logged to both handlers.');
Expected result:
----------------
No errors!
Actual result:
--------------
Notice: Undefined index: class in /home/lapuce/php/Log.php on line 459
(it works if I remove %{file} from lineFormat)
(they work if I use individual, non-composite log)
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=17356&edit=1