add buffer and log