How can I log the moments before a crash reboot? If I check the syslog, all I see is a log from the recent boot.

I was having a lot of reboots yesterday. I'm trying to figure out if the power button was getting stuck or whether it was software.