[line 28]
The Log_mail class is a concrete implementation of the Log:: abstract class which sends log messages to a mailbox.
The mail is actually sent when you close() the logger, or when the destructor is called (when the script is terminated).
PLEASE NOTE that you must create a Log_mail object using =&, like this : $logger =& Log::factory("mail", "recipient@example.com", ...)
This is a PEAR requirement for destructors to work properly. See http://pear.php.net/manual/en/class.pear.php
Log_mail (Constructor) [line 119]
Log_mail Log_mail(
string
$name, [string
$ident = ''], [array
$conf = array()], [int
$level = PEAR_LOG_DEBUG])
Constructs a new Log_mail object.
Here is how you can customize the mail driver with the conf[] hash : $conf['from']: the mail's "From" header line, $conf['subject']: the mail's "Subject" line. $conf['mailBackend']: backend name of PEAR::Mail $conf['mailParams']: parameters for the PEAR::Mail backend
Parameters:
string
$name
—
The message's recipients.
string
$ident
—
The identity string.
array
$conf
—
The configuration array.
int
$level
—
Log messages up to and including this level.
close [line 198]
Closes the message, if it is open, and sends the mail.
This is implicitly called by the destructor, if necessary.
Overrides
Log::close() (Abstract implementation of the close() method.)
flush [line 242]
Flushes the log output by forcing the email message to be sent now.
Events that are logged after flush() is called will be appended to a new email message.
- Since: Log 1.8.2
- Access: public
Overrides
Log::flush() (Abstract implementation of the flush() method.)
log [line 263]
boolean log(
mixed
$message, [string
$priority = null])
Writes $message to the currently open mail message.
Calls open(), if necessary.
- Return: True on success or false on failure.
- Access: public
Overrides
Log::log() (Abstract implementation of the log() method.)
Parameters:
mixed
$message
—
String or object containing the message to log.
string
$priority
—
The priority of the message. Valid values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT, PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING, PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
open [line 179]
Starts a new mail message.
This is implicitly called by log(), if necessary.
Overrides
Log::open() (Abstract implementation of the open() method.)