This one’s easy. Place this in your php.ini (don’t forget to restart, if needed).
mail.add_x_header = On mail.log = /var/log/phpmail.log
You can change the log file location, of course.
Note that mail.add_x_header will add the script file to the email header allowing someone to see which file generated the email. This may be a security issue for your site, so be careful.