Trying to get execution result in a separate log file with help of spike

I have been using spike -d option to get into debug mode and then generating equivalent RISC-V instructions for a particular C program, but i want that in a separate log file with result of each and every destination register. Can anyone help me out in this?