Not really a PHP related question but here goes:
The way I did it was to add the following to my syslog.conf (in /etc)
mail.debug /var/log/maillog
That makes sure anything of debug level or greater gets logged into /var/log/maillog - the great thing about syslog is that it can roll the log files over after a cetain time or once they reach a certain size - making sure you never have huge logs lying around.
Of course, for any of this to work, you need syslogd installed and running (I think it is by default on just about every unix setup)