Robot C has a nice data logging feature for the NXT, it lets you save information to a text file on the nxt to be uploaded and reviewed later. Here is some code data logging code I made a looooong time ago, it should still work. Let me know if this is what you were looking for.
Also when using more than one sonar sensor at the same time, a ping that one sensor sends out may be read by the other sonar sensor and cause bad readings like you were exsperiencing. You may want to look into pinging one sensor at a time and reading the result before pinging the next sensor B-)
Good luck! hope this helps B-)