New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I save the sendlog to file without output? #911
Comments
It's not quite clear, but I assume you mean you want to capture debug output when SMTPDebug = 2. You can do this by injecting a function into the $mail->SMTPDebug = 2;
$mail->Debugoutput = function($str, $level) {
file_put_contents('smtp.log', gmdate('Y-m-d H:i:s'). "\t$level\t$str\n", FILE_APPEND | LOCK_EX);
}; This is described in the source code. |
Hi Synchro, |
(moved comment to #1795) |
One thing that I've done with this log file problem is to append a date to the log file and then change that date at a reasonable interval. So, for one application which does not log very much, I append the year-month to the name (e.g. smtp_2020-06.log) and then start a new file the next month (e.g. smtp_2020-07.log). You could modify this to start a new log file every week or every day if you wanted depending on your needs. |
No description provided.
The text was updated successfully, but these errors were encountered: