Background of question
Analysis of Zend_Log reveals following Class Diagram
Zend_Log:
Zend_Log_Writer_Abstract
Questions
Regards!
Zend_Log_Filter_Suppress
, Zend_Log_Filter_Message
, and Zend_Log_Filter_Priority
all implement the Zend_Log_Filter_Interface
interface. This is denoted using the empty arrow and dotted lines between them. The same is true for Zend_Log_Formatter_Interface
and the three classes depicted below it.
Yes, that's correct. Whether to use an association (-->) or composition here could be debated since two Zend_Log
instances could share a single Zend_Log_Writer_Db
instance. As the writers and filters determine the overall behavior of the log, composition makes sense to me.
Each log instance can write to multiple writers. Messages are first filtered by the log itself, and any message that passes goes to every writer. Each writer filters the incoming messages as well. This allows you to ignore all messages below the WARN
priority (at the log level) which get written to a file and further limit database logging to those at the FATAL
level. You could accomplish the same effect by dropping the log-level filter array, but it would require duplicating the filtering in each writer.