compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (10)

View Page History
{note:title=Under construction}
Mind this proposal is still in draft!
{note}

{zone-template-instance:ZFPROP:Proposal Zone Template}

||UC-01||

config.ini (The namespace property is only to indicate support for namespace prefix. Its defaults to the one configured): Zend_Log_Writer):
{code}
log.file.writerName = "Stream"
log.file.writerNamespace = "Zend_Log_Writer"
log.file.writerParams.stream = "/home/kieskeurig/prod_kieskeurig/application/logs/application.log" "/path/to/application.log"
log.file.filterName = "Priority"
log.file.filterParams.priority = "Zend_Log::CRIT"
log.file.filterParams.operator = "<="
log.firebug.writerName = "Firebug"
log.db.writerName = "Db"
log.db.writerParams.adapter "Mysqli"
log.db.writerParams.params.host = "localhost"
log.db.writerParams.params.username = "user"
log.db.writerParams.params.password = "pass"
log.db.writerParams.params.dbname = "dbname"
{code}
bootstrap/setup

bootstrap/setup
{code}
require 'Zend/Log.php';

{zone-data:skeletons}
{code}

Zend_Log:
Zend_Log
{code}
/**
* Factory to construct the Zend_Log and add writers based on the

{code}

Example of how to implement it with the Zend_Log_Writer_Db
{code}
/**
* Class constructor
*
* @param mixed $dbOrConfig Zend_Db_Adapter Database adapter instance or config array
* @param string $table Log table in database
* @param array $columnMap
*/
public function __construct($dbOrConfig, $table = null, $columnMap = null)
{
if(count(func_get_args()) == 1) {

if(!is_array($dbOrConfig)) {
throw new Zend_Log_Exception("Unsupported configuration. Pass a configuration array");
}

$this->_table = $dbOrConfig['table'];
unset($dbOrConfig['table']);

$this->_columnMap = $dbOrConfig['columnMap'];
unset($dbOrConfig['columnMap']);

/** Construct Zend_Db **/
require_once 'Zend/Db.php';
$this->_db = Zend_Db::factory($dbOrConfig);

} else {
$this->_db = $dbOrConfig;
$this->_table = $table;
$this->_columnMap = $columnMap;
}
}
{code}
{zone-data}