This is OpenWrt Linux. The logd
daemon is responsible for it on a stock OWRT device. They can be shipped off (let’s say near real time) to a remote server/DB for analysis… over a VPN, of course, given the nature of their contents.
Interface link up/down/loss/events inc. Wi-Fi, are already logged by default. Button press can be depending on the specific device but custom scripts are required*. Application issues can be, provided the approp. monitoring agent software & augmentation via custom scripts (we’ve discussed that aspect a bit already re: ‘auto-heal’ functionality).
Power outage events aren’t recordable by default as, well, the device would be off but I intended to bring this aspect up with 'ya anyway in a future query. By its default configuration the device would lose that set of logs (they’re not flushed to a disk on a stock config)… but if a UPS is connected to the OWRT device, said device could operate as controller that issues power down/up[ commands to any subnet attached equipment. The controller is going to comparably ‘sip’ power fr the UPS than a Xeon server w/ 10 drives attached for instance, so automating the full rack’s restoration when AC is stable is within the realm of possibility.
It’s how I had my pair of 2U Xeons ‘beasts’ power up/down automatically when seasonal storm blackouts rolled through some years ago. I’m fond of Eaton’s ‘PowerWare’ lineup; they openly advertised Linux compatibility on certain models. I think they’ve changed their naming convention since then so specific model numbers would have to be checked. They still advertise Red Hat Enterprise Linux support so that’s a positive sign.
So in short: if a properly supported UPS is attached to a properly configured GL/OWRT device, logs can include AC power events along with almost anything else & sent to wherever they need to be… like a DB via VPN.
*