Here you can find the source of printPrettyJson(Logger logger, String json)
public static void printPrettyJson(Logger logger, String json)
//package com.java2s; //License from project: Open Source License import org.slf4j.Logger; import com.fasterxml.jackson.databind.ObjectMapper; public class Main { public static void printPrettyJson(Logger logger, String json) { try {// ww w.j a v a 2s . c o m ObjectMapper mapper = new ObjectMapper(); logger.info(mapper.writerWithDefaultPrettyPrinter() .writeValueAsString(mapper.readValue(json, Object.class))); } catch (Exception e) { e.printStackTrace(); } } }