Zend Framework

Zend_Log_Writer_Mail : implement factory()

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Log
  • Labels:
    None

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.

  1. Zend_Log-Factory-fr.xml.patch
    05/Sep/10 10:59 PM
    7 kB
    Benoît Durand
  2. Zend.Log.Writer.Mail.php.patch
    10/Aug/10 6:31 PM
    4 kB
    Renan de Lima
  3. Zend.Log.Writer.MailTest.php.patch
    10/Aug/10 6:31 PM
    2 kB
    Renan de Lima
  4. ZF-9990.patch
    05/Sep/10 10:59 PM
    19 kB
    Benoît Durand

Issue Links

Activity

Hide
Renan de Lima added a comment -

my personal implementation patch. Benoit, i didn't stopped writing tests, if you want you can assing to me.

Show
Renan de Lima added a comment - my personal implementation patch. Benoit, i didn't stopped writing tests, if you want you can assing to me.
Hide
Renan de Lima added a comment -

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

Show
Renan de Lima added a comment - 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
Hide
Benoît Durand added a comment -

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.

Show
Benoît Durand added a comment - 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.
Hide
Renan de Lima added a comment -

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?

Show
Renan de Lima added a comment - 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?
Hide
Benoît Durand added a comment -

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' ?

Show
Benoît Durand added a comment - 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' ?
Hide
Ramon Henrique Ornelas added a comment -

Hi Ralph

See that this improvement is dependent ZF-4955.

Show
Ramon Henrique Ornelas added a comment - Hi Ralph See that this improvement is dependent ZF-4955.
Hide
Benoît Durand added a comment -

I add a new key :
resources.log.mail.layoutFormatter = "Zend_Log_Formatter_Simple"

Show
Benoît Durand added a comment - I add a new key : resources.log.mail.layoutFormatter = "Zend_Log_Formatter_Simple"
Hide
Benoît Durand added a comment -

Patch, unit tests, doc en and fr

Show
Benoît Durand added a comment - Patch, unit tests, doc en and fr
Hide
Benoît Durand added a comment -

r22962

Show
Benoît Durand added a comment - r22962

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: