Could it just set up to do like Command | tee -a activity.log | tail -5
So the context only gets a few lines but everything is still logged?