Fix log formats and rewrite rule