How can I detect sub-second interruptions in mains electricity supply?
Personally I would solder your self-latching relay solution. It's simple. If you don't like working with 240V, maybe an AC relay after a transformer or even a DC relay after a USB charger could work. Of course, check to make sure it triggers on brief interruptions.
You can even connect a clock to the switched side (e.g. a timer - but one with a mechanical motor) and determine when the outage happened based on when the clock stopped.
Have you looked at &quot;power logger&quot; &quot;voltage logger&quot; or &quot;energy logger&quot;? You'd have to check the specs if glitches are recorded. A &quot;data logger&quot; and the &quot;voltage logger&quot; are likely the most versatile to log brief/glitch events.
Alternatively, you can

record the DC voltage after a usb charger and a tone generator using a voice recorder app, and use a simple computer script or audio editor to find the time and duration. Or record the AC hum/cycle, double it to 100Hz using a rectifier bridge, in case 50Hz is filtered out before recording.
use a video triggered webcam directed at a light to get the time info. The ensuing &quot;dark flash&quot; would have to trigger a recording, and it can even notify you by WiFi
hook up a relay to an alarm circuit, a cheap one with WiFi/internet notification and logging.

If any of these get close to what you would like to try, we can discuss the details if needed, to help you further along.