I have a working project in Tasker, the famous Android automation app. Its main profiles monitor the system logs (via the logcat trigger) for an event, and run
logcat