ZF-11795: Zend_Log_Writer_Stream ignores config params for formatter (formatter class name and params hardcoded in constructor)

Issue Type: Bug Created: 2011-10-04T06:44:46.000+0000 Last Updated: 2011-10-08T11:04:04.000+0000 Status: Closed Fix version(s): Reporter: Sergey Boroday (simpliest) Assignee: Benoît Durand (intiilapa) Tags: - Zend_Log

Related issues: Attachments:


Example (config.ini);

<pre class="highlight">
resources.log.AppLog.writerName = "Stream" = APPLICATION_PATH "/../logs/app.log"
resources.log.AppLog.writerParams.formatterName = "Zend_Log_Formatter_Simple"
resources.log.AppLog.writerParams.formatterParams.format = "%timestamp% ID: %id% %priorityName% (%priority%): %message%" PHP_EOL "%info%" PHP_EOL

After bootstrap we will get formatter and format values by default but not by config.


Posted by Benoît Durand (intiilapa) on 2011-10-08T11:03:34.000+0000

A unit test validates the behavior. I think it's more a concern of configuration or documentation: you must use shortname for a *name like formatterName.

Try this :

<pre class="highlight">
resources.log.AppLog.writerParams.formatterName = "Simple"

Be careful to use the info parameter with this formatter. If you have a log without extra, your file write without interpretation %info%.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.