optimazing logging