Class Mail

Summary

Fully Qualified Name: Zend\Log\Writer\Mail
Extends: AbstractWriter

Description

Class used for writing log messages to email via Zend\Mail.

Allows for emailing log messages at and above a certain level via a Zend\Mail\Message 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 Zend\Mail\Transport\TransportInterface object (Sendmail is default).

Methods

Name Description Defined By
__construct() Constructor Mail
addFilter() Add a filter specific to this writer. AbstractWriter
filterPlugin() Get filter instance AbstractWriter
formatterPlugin() Get formatter instance AbstractWriter
getFilterPluginManager() Get filter plugin manager AbstractWriter
getFormatterPluginManager() Get formatter plugin manager AbstractWriter
setConvertWriteErrorsToExceptions() Set convert write errors to exception flag AbstractWriter
setFilterPluginManager() Set filter plugin manager AbstractWriter
setFormatter() Set a new formatter for this writer AbstractWriter
setFormatterPluginManager() Set formatter plugin manager AbstractWriter
setSubjectPrependText() Allows caller to have the mail subject dynamically set to contain the entry counts per-priority level. Mail
setTransport() Set the transport message Mail
shutdown() Sends mail to recipient(s) if log entries are present. Note that both plaintext and HTML portions of email are handled here. Mail
write() Log a message to this writer. AbstractWriter

Method Details

__construct()

Constructor

Parameter Name Type Description
$mail \MailMessage|array|\Traversable
$transport \Transport\TransportInterface Optional

Returns:

addFilter()

Add a filter specific to this writer.

Parameter Name Type Description
$filter int|string|\Filter\FilterInterface
$options array|null

Returns: \AbstractWriter

filterPlugin()

Get filter instance

Parameter Name Type Description
$name string
$options array|null

Returns: \Filter\FilterInterface

formatterPlugin()

Get formatter instance

Parameter Name Type Description
$name string
$options array|null

Returns: \Formatter\FormatterInterface

getFilterPluginManager()

Get filter plugin manager

Returns: \LogFilterPluginManager

getFormatterPluginManager()

Get formatter plugin manager

Returns: \LogFormatterPluginManager

setConvertWriteErrorsToExceptions()

Set convert write errors to exception flag

Parameter Name Type Description
$convertErrors bool

Returns:

setFilterPluginManager()

Set filter plugin manager

Parameter Name Type Description
$plugins string|\LogFilterPluginManager

Returns: self

setFormatter()

Set a new formatter for this writer

Parameter Name Type Description
$formatter string|\Formatter\FormatterInterface
$options array|null

Returns: self

setFormatterPluginManager()

Set formatter plugin manager

Parameter Name Type Description
$plugins string|\LogFormatterPluginManager

Returns: self

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 Zend\Mail\Message subject can only be set once, this method cannot be used if the Zend\Mail\Message object already has a subject set.

Parameter Name Type Description
$subject string Subject

Returns: \Mail

setTransport()

Set the transport message

Parameter Name Type Description
$transport \Transport\TransportInterface

Returns: \Mail

shutdown()

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

Returns:

write()

Log a message to this writer.

Parameter Name Type Description
$event array log

Returns: void

Top