Is there anywhere in the ubuntu (or linux in general) logs which can record a computer booting up and the OS failing to load, due to a problem encountered during the boot stage?
you can check it into
This directory has all types of logs
While I'll find Shekhar Raut answer correct, I think the list could be a bit shorther.
Since OP is asking about booting and nothing else - kernel logs in Linux (in general) can be found at:
So, if you have a boot failure due to some hardware problem, this should be the first place to look at.
Looks like Ubuntu removed this log file since 12.04 (not confirmed), and now the right place to look for the system logs is:
Starting with Ubuntu 12.04 (AFAIK), there is
contains the logs produced by the kernel during boot. after boot there is nearly no event added but you will see the uptime on each entry