Added checks for size of logger buffer