Limit log to 5000 lines