I'm guessing you've not dealt with power electronics and batteries terribly much.
Depending on what limit has been hit, it's quite likely there is no way to log the cause of the error. Low voltage protection circuitry on most batteries doesn't have a status line. It's never supposed to trigger except in exceptional cases, and it just cuts power. All you know is that the power disappeared suddenly, and you've rebooted. Telling the difference between that and assorted other hardware faults, especially if you never designed the hardware to look for it, is really difficult.
You can certainly design a system that will latch the cause of the shutdown in the battery management IC - but you can't really add this in after the fact.
Depending on what limit has been hit, it's quite likely there is no way to log the cause of the error. Low voltage protection circuitry on most batteries doesn't have a status line. It's never supposed to trigger except in exceptional cases, and it just cuts power. All you know is that the power disappeared suddenly, and you've rebooted. Telling the difference between that and assorted other hardware faults, especially if you never designed the hardware to look for it, is really difficult.
You can certainly design a system that will latch the cause of the shutdown in the battery management IC - but you can't really add this in after the fact.