Is it possible to monitor systemd service (unit), if it produces logs, and if no log is produced in (lets say 5 minutes), restart the service?
So you can put logic based on below scenarios:
 Check pid if exists, if not restart application.
 Check log if not produced for some time(check what threshold you want to put), restart service.
journalctl <your application binary>
 If your application support endpoints for health check, you can write on top of it.
Actually we need to identify difference between idle and not working while checking logs, So I think checking single thing is not enough.