There's any way looking into some logs to discover what caused the restart?
Currently Raspbian still puts a copy of everything into /var/log/syslog. You need privileges to access this file, i.e., either su root or use sudo less .... or sudo cat ... or sudo grep .....
You are looking for the messages that indicate the beginning of the last boot; these will begin something like:
Feb 6 21:27:19 localhost rsyslogd: [origin software="rsyslogd" swVersion="8.10.0" x-pid="7932" x-info="http://www.rsyslog.com"] start
Feb 6 21:27:19 localhost kernel: [ 0.000000] Initializing cgroup subsys cpuset
Beware your hostname is not necessarily localhost.
There may be some difference in the content of the second message, but this is the point at which the system logger (rsyslog1) copies in the stuff you can see with dmesg, which is the kernel speaking. Kernel timestamps (e.g. [ 0.000000]) are in seconds (so have microsecond granularity); the date/clock timestamp is added by the rsyslog itself so will always be present whereas the kernel ones will only be for messages from the kernel itself (hence rsyslog's "start" message doesn't have one).
Since that indicates the last boot, you are looking for the messages immediately before these two lines. For a normal shutdown, the last one should be something like:
Feb 9 22:32:32 localhost rsyslogd: [origin software="rsyslogd" swVersion="8.10.0" x-pid="11188" x-info="http://www.rsyslog.com"] exiting on signal 15.
One problem with failures is that if they are sudden or involve some kind of crippling due to resource issues (out of RAM, hogged processor) the system may not have synced to disk and error messages will not have made it into the file.
1. Actually, there's another system logger integrated into systemd, the init system, called journald. However, since it's files are not human readable text it is not of much use particularly if you are, e.g., examining a card from a failed system in another computer.
pi@raspberrypi:/var/log $ uptime -s 2016-02-27 23:23:27but looking at old syslog I see nothing strange just my cron job and then the restart
– Derek Wildstar Mar 02 '16 at 11:33Feb 27 23:17:01 raspberrypi CRON[23010]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Feb 27 23:17:04 raspberrypi rsyslogd: [origin software="rsyslogd" swVersion="8.4.2" x-pid="429" x-info="http://www.rsyslog.com"] start Feb 27 23:17:04 raspberrypi systemd-modules-load[82]: Inserted module 'fuse' Feb 27 23:17:04 raspberrypi systemd-modules-load[82]: Inserted module 'i2c_dev'