My apartment experiences frequent power outages. After a power outage there is an about 50% chance of the pi not booting. Unplugging it and plugging it back in usually causes it to boot. Is there anything I can do in software? Like waiting a few seconds after connecting to power for booting or trying again after some time? Are there logs I can look at?
The Pi should boot when power is applied.
There is a hardware watchdog in the SOC which can be used to reboot of failure.
See https://raspberrypi.stackexchange.com/a/68332/8697 (NOTE the bug mentioned is fixed in Stretch)