2079. Class

2079.1. Zend\Log\Writer\Mail

Class used for writing log messages to email via ZendMail.

Allows for emailing log messages at and above a certain level via a ZendMailMessage object. Note that this class only sends the email upon completion, so any log entries accumulated are sent in a single email. The email is sent using a ZendMailTransportTransportInterface object (Sendmail is default).

2079.1.1. Methods

2079.1.1.1. __construct

__construct()

Constructor

Parameters:
  • MailMessage|array|Traversable
  • TransportTransportInterface – Optional
Throws ExceptionInvalidArgumentException:
 

2079.1.1.2. setTransport

setTransport()

Set the transport message

Parameters:TransportTransportInterface
Return type:Mail

2079.1.1.3. doWrite

doWrite()

Places event line into array of lines to be used as message body.

Parameters:array – Event data

2079.1.1.4. setSubjectPrependText

setSubjectPrependText()

Allows caller to have the mail subject dynamically set to contain the entry counts per-priority level.

Sets the text for use in the subject, with entry counts per-priority level appended to the end. Since a ZendMailMessage subject can only be set once, this method cannot be used if the ZendMailMessage object already has a subject set.

Parameters:string – Subject prepend text
Return type:Mail

2079.1.1.5. shutdown

shutdown()

Sends mail to recipient(s) if log entries are present. Note that both plaintext and HTML portions of email are handled here.

2079.1.1.6. getFormattedNumEntriesPerPriority

getFormattedNumEntriesPerPriority()

Gets a string of number of entries per-priority level that occurred, or an empty string if none occurred.

Return type:string