512 * 1024? Perhaps move this to a constant, like MAX_LOG_SIZE?