Update logic in daemon & app to purge old logs

 Asked upstream for a log flush endpoint. Will update later.