add logging support and rotation