Skip to main content
Version: Fegg 5.x

Mail::log

Append a message to the log file

Description​

public boolean Mail::log( string $message )

Appends a separator line and $message to the log file (Mail::logFile: the file given to Mail::setDebugFlag, by default mail.log in the log directory). Nothing is written when the file or its directory is not writable. The return value is always true.

Mail::send calls this method with the whole message when the debug flag is enabled.

Arguments​

NameData typeDefaultRemarks
$messagestringLog message

Example​

Controller
use Fegg\Tool\Mail;

$mail = new Mail();
$mail->setDebugFlag(true);
$mail->log('Contact form posted');