Some logging cleanup. Pretty print for JSON