Recently, my laptop has started turning off for no apparent reason; it's an old laptop and the problem is likely to be a hardware issue, but I was wondering if there were any Ubuntu logs that might shed some light on the issue?
As there is a brief delay before the logs are written to disk, nothing may have been recorded, however something of general interest concerning the power management of your laptop may be found by using
dmesg | grep -i acpi
To go back further in time and to show dates alongside the results, you could grep all the
kernel logs for
grep -i acpi /var/log/kern*
which will give a lot of messages, but may perhaps show any issues to do with power management.
One cause of a machine turning off is that the CPU is too hot and has reached a critical trip point and the machine is powered off, so it could be that.
With this kind of power-off situation you may not get any logs to look at because the machine is powered off before the log messages are flushed to disk.