How to log only failures in an external file, from php unit? I want the complete information, including actual value, expected value, line number etc. Right now I am using fwrite and logging all pass and fail tests into a file, is there a better way to do it?