Log/Writer/Mail.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Log
- Subpackage
- Writer
- Version
- $Id: Mail.php 24593 2012-01-05 20:35:02Z matthew $
Package: Zend\Log\WriterClass 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 object. Note that this class only sends the email upon
completion, so any log entries accumulated are sent in a single email.
- Parent(s)
- \Zend_Log_Writer_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id: Mail.php 24593 2012-01-05 20:35:02Z matthew $
Properties



array $_eventsToMail = array()
Array of formatted events to include in message body.
Default valuearray()
Details- Type
- array



array $_layoutEventsToMail = array()
Array of formatted lines for use in an HTML email body; these events
are formatted with an optional formatter if the caller is using
Zend_Layout.
Default valuearray()
Details- Type
- array



array $_methodMapHeaders = array('from' => 'setFrom', 'to' => 'addTo', 'cc' => 'addCc', 'bcc' => 'addBcc')
staticMethodMap for Zend_Mail's headers
Default valuearray('from' => 'setFrom', 'to' => 'addTo', 'cc' => 'addCc', 'bcc' => 'addBcc')
Details- Type
- array



array $_numEntriesPerPriority = array()
Array keeping track of the number of entries per priority level.
Default valuearray()
Details- Type
- array
Methods



_constructLayoutFromConfig(array $config) : \Zend_Layout
Construct a Zend_Layout instance based on a configuration array
ParametersName | Type | Description |
---|
$config | array | |
---|
ReturnsThrows 


_constructMailFromConfig(array $config) : \Zend_Mail
staticConstruct a Zend_Mail instance based on a configuration array
ParametersName | Type | Description |
---|
$config | array | |
---|
ReturnsThrows 


_parseConfig(array | \Zend_Config $config) : array
ParametersName | Type | Description |
---|
$config | array | \Zend_Config | Zend_Config or Array |
---|
ReturnsThrows 


_write(array $event) : void
Places event line into array of lines to be used as message body.
Handles the formatting of both plaintext entries, as well as those
rendered with Zend_Layout.
ParametersName | Type | Description |
---|
$event | array | Event data |
---|



setLayoutFormatter(\Zend_Log_Formatter_Interface $formatter) : \Zend_Log_Writer_Mail
Sets a specific formatter for use with Zend_Layout events.
Allows use of a second formatter on lines that will be rendered with
Zend_Layout. In the event that Zend_Layout is not being used, this
formatter cannot be set, so an exception will be thrown.
ParametersReturnsThrows


setSubjectPrependText(string $subject) : \Zend_Log_Writer_Mail
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 subject can only be set
once, this method cannot be used if the Zend_Mail object already has a
subject set.
ParametersName | Type | Description |
---|
$subject | string | Subject prepend text. |
---|
ReturnsThrows


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



write(array $event) : void
ParametersName | Type | Description |
---|
$event | array | log data event |
---|