ZF-9990: Zend_Log_Writer_Mail : implement factory()
Description
Implement the factory method for the class Zend_Log_Writer_Mail in order to configure all writers of Zend_Log with a Zend_Config.
Implement the factory method for the class Zend_Log_Writer_Mail in order to configure all writers of Zend_Log with a Zend_Config.
Comments
Posted by Renan de Lima (renanbr) on 2010-06-19T18:17:54.000+0000
my personal implementation patch. Benoit, i didn't stopped writing tests, if you want you can assing to me.
Posted by Renan de Lima (renanbr) on 2010-08-10T18:31:42.000+0000
attached my local changes that implements this issue and its tests, all green ;-) i will wait until next week before i assign this issue to me and commit to trunk
Posted by Benoît Durand (intiilapa) on 2010-08-12T12:27:27.000+0000
It's a generic approach to allow every setters ^^ It lacks a configuration setting for the method setSubjectPreprendText() for me. I think this feature should allow multiple recipients. This should be possible by providing an array for the header To, and the fact that we can define an array in an application configuration.
I am surprised that the unit tests contain any assertion.
Posted by Renan de Lima (renanbr) on 2010-08-12T12:48:23.000+0000
yes Benoit, it's a generic setter
about writer configuration you are right, current solution allow us to configure mail object, but it doesn't allow to configure log writer object, it needs to be fixed
about multiple recipients i think you are right again, it should allow set multiple recipients
forget the current solution, let's try solve this starting from usage, could this piece of application.ini file bellow a nice way to represent your wishes?
resources.log.mail.writerName = "Mail" resources.log.mail.writerParams.layout = "Zend_Layout" resources.log.mail.writerParams.layoutOptions[] = resources.log.mail.writerParams.mail = "Zend_Mail" resources.log.mail.writerParams.subjectPrepend = "[error] " resources.log.mail.writerParams.from = "system@domain" resources.log.mail.writerParams.to[] = "admin1@domain" resources.log.mail.writerParams.to[] = "admin2@domain" resources.log.mail.writerParams.cc[] = "admin3@domain" resources.log.mail.writerParams.cc[] = "admin4@domain" resources.log.mail.writerParams.bcc[] = "admin5@domain" resources.log.mail.writerParams.ccc[] = "admin6@domain"
what do you think about?
Posted by Benoît Durand (intiilapa) on 2010-08-16T10:25:28.000+0000
Renan, here are some uses with comments that I think: resources.log.mail.writerName = "Mail"
resources.log.mail.writerParams.layout = "Zend_Layout" resources.log.mail.writerParams.layoutOptions[] = (optional)
resources.log.mail.writerParams.mail = "Zend_Mail" (optional)
resources.log.mail.writerParams.charset = "utf-8" (may be add a method Zend_Mail::addCharset() is an other issue or with the constuctor of the mail class)
resources.log.mail.writerParams.subjectPrepend = "[error] " or resources.log.mail.writerParams.subject = "error on domain"
resources.log.mail.writerParams.from.email = "system@domain" resources.log.mail.writerParams.from.name = "syslog" (someone can want to define a name)
resources.log.mail.writerParams.to[] = "admin1@domain" resources.log.mail.writerParams.to[] = "admin2@domain" resources.log.mail.writerParams.cc[] = "admin3@domain" resources.log.mail.writerParams.cc[] = "admin4@domain" resources.log.mail.writerParams.bcc[] = "admin5@domain" (ok)
resources.log.mail.writerParams.ccc[] = "admin6@domain" What is 'ccc' ?
Posted by Ramon Henrique Ornelas (ramon) on 2010-08-24T18:08:12.000+0000
Hi Ralph
See that this improvement is dependent ZF-4955.
Posted by Benoît Durand (intiilapa) on 2010-08-26T12:05:19.000+0000
I add a new key : resources.log.mail.layoutFormatter = "Zend_Log_Formatter_Simple"
Posted by Benoît Durand (intiilapa) on 2010-09-05T22:59:15.000+0000
Patch, unit tests, doc en and fr
Posted by Benoît Durand (intiilapa) on 2010-09-18T10:10:08.000+0000
r22962