I tried adding
- Code: Select all
define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );
But I prefer to use /wp-content/debug.log so I hope someone can help with setting up the permissions correctly.
Thanks!
- Code: Select all
// An example wp_mail() override that you can place in your site's wp-config.php
// https://www.itthinx.com/2021/09/06/wordpress-mail-debugging/
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
$output = sprintf(
"\n\n" .
"---------- Caught email ---------- \n\n" .
"To: %s\n\n" .
"Subject: %s\n\n" .
"Message: %s\n\n" .
"Headers: %s\n\n" .
"Attachments: %s\n\n" .
"---------------------------------- \n\n" .
"\n\n",
$to,
$subject,
$message,
json_encode( $headers ),
json_encode( $attachments )
);
error_log( $output );
return true;
}
/* That's all, stop editing! Happy publishing. */