Implemented a maximum buffer size.

Also added a recovery mechanism that adds logs back in if a post
request fails for some reason