is there any example how to setup an instance of zend log from application.ini? I have only found an example for logging to an file, but i want to log into an SQLITE database table?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Since ZF 1.10alpha (at least), the following has been true.
NOTE: the arbitrary array key 'firebug'. When the Zend_Log factory churns over the resource's log config, example 1 will be passed as an array to Zend_Log->addWriter() (triggering the _constructWriterFromConfig() method), whilst example 2 will simply pass a string (triggering an exception).
(I know this is old, and I'm using a Firebug logger example, but the same applies to all log writers)
Good question. I can't find a way to instantiate the
Zend_Log_Writer_Db
from a bootstrap config. The writer class requires aZend_Db_Adapter
object. It doesn't accept a string.The ZF project needs to develop this use case further. They don't even have any unit tests for
Zend_Application_Resource_Log
that include a Db writer.The best I can suggest until then is that you Bootstrap class needs to customize the Log resource in an
_initLog()
method.This should work - I will test fully later (not at my dev machine now)
Zend_Application_Resource_Log can setup an instance of a Zend_Log from application.ini
Here in the manual: you can find an example how to write your log file into the database.Is that what you mean?