Hi all,
In my application I want to use zend_log to log almost everything... accounting, errors and sporadic warnings. So in my mind I've have this schema
,-(sporadic warnings)-. ,-> Some messages to file
/ \ /
Application -> +--> Error Controller ---+-> Zend_log -> +---> Some
messages to Database
\ / \
`--- (accounting) ----' `-> Some
messages send by email
To avoid each time I want to log something to add writers, filters and so on, I decide to extend Zend_Log, in which the construct accept the message, and an option error code, and in the constructor I add the writers, filters and new EventItem to be logged like, username, module, controller and action.
Reading the documentation, send it to database will be easy because it have columnMapping and to send by email I will have to write a writer. But I've a problem in the Zend_Log_Writer_Stream. It only accept the file name, and inside the constructor it add formatter Zend_Log_Formatter_Simple. In Zend_Log_Formatter_Simple only is sent to file the four base fields and I want to put in file the four extra fields.
There is another way to solve this problem, which not include re-write Zend_Log_Writer_Stream to add a different formatter or to change the single line in the source Zend_Log_Formatter_Simple?
Regards, Filipe Carvalho
smime.p7s
Description: S/MIME Cryptographic Signature
