Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TEmailLogRoute

TComponent
   |
   --TApplicationComponent
      |
      --TLogRoute
         |
         --TEmailLogRoute

TEmailLogRoute class.

TEmailLogRoute sends selected log messages to email addresses. The target email addresses may be specified via Emails property. Optionally, you may set the email Subject and the SentFrom address.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
array
string
string
void
init ( TXmlElement $config)
Initializes the route.
protected  void
processLogs ( array $logs)
Sends log messages to specified email addresses.
array|string
setEmails ( mixed $emails)
void
setSentFrom ( string $value)
void
setSubject ( string $value)
Methods Inherited From TLogRoute
TLogRoute::collectLogs(), TLogRoute::formatLogMessage(), TLogRoute::getCategories(), TLogRoute::getLevelName(), TLogRoute::getLevels(), TLogRoute::getLevelValue(), TLogRoute::init(), TLogRoute::setCategories(), TLogRoute::setLevels()
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods Inherited From TComponent
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()

Constant Summary
string DEFAULT_SUBJECT Default email subject.
string EMAIL_PATTERN Regex pattern for email address.

Method Details

getEmails

public array getEmails ()

Output
array list of destination email addresses
Exception

getSentFrom

public string getSentFrom ()

Output
string send from address of the email
Exception

getSubject

public string getSubject ()

Output
string email subject. Defaults to TEmailLogRoute::DEFAULT_SUBJECT
Exception

init

public void init (TXmlElement $config )

Initializes the route.

Input
TXmlElement$configconfigurations specified in TLogRouter.
Output
Exception
throwsTConfigurationException if SentFrom is empty and 'sendmail_from' in php.ini is also empty.

processLogs

protected void processLogs (array $logs )

Sends log messages to specified email addresses.

Input
array$logslist of log messages
Output
Exception

setEmails

public array|string setEmails (mixed $emails )

Input
mixed$emails
Output
array|string list of destination email addresses. If the value is a string, it is assumed to be comma-separated email addresses.
Exception

setSentFrom

public void setSentFrom (string $value )

Input
string$valuesend from address of the email
Output
Exception

setSubject

public void setSubject (string $value )

Input
string$valueemail subject.
Output
Exception


Constant Details

DEFAULT_SUBJECT

Default email subject.

Type:

string

Value:

'Prado Application Log'

EMAIL_PATTERN

Regex pattern for email address.

Type:

string

Value:

'/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/'