Gets a json form of the list of logger.

@return the list of loggers as json.
509333
@Route(method = HttpMethod.GET, uri = "/monitor/logs/loggers")
    public Result loggers() {
        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        List<LoggerModel> loggers = new ArrayList<>();
        for (Logger logger : context.getLoggerList()) {
            loggers.add(new LoggerModel(logger));
        }
        return ok(loggers).json();
    }
522271
def _get_formatter(self, json):
        '''
        
        '''
        if json:
            return jsonlogger.JsonFormatter()
        else:
            return logging.Formatter(self.format_string)
233745
private String toJSONString() {
        JSONStringer js = new JSONStringer();
        try {
            js.object();
            for (Map.Entry<Integer, Integer> entry : m_tokensMap.get().entrySet()) {
                js.key(entry.getKey().toString()).value(entry.getValue());
            }
            js.endObject();
        } catch (JSONException e) {
            throw new RuntimeException("Failed to serialize Hashinator Configuration to JSON.", e);
        }
        return js.toString();
    }
998651
public String getJSONMessages() {
		StringBuilder builder = new StringBuilder();
		builder.append("{");
		
		boolean first = true;
		Enumeration<String> keys = this.bundle.getKeys();
		while (keys.hasMoreElements()) {
			if (!first)
				builder.append(",");
			else
				first = false;
			String key = keys.nextElement();
			String value = this.getMessage(key);
			String escaped = value.replaceAll("\\'", "\\\\'");
			builder.append("'").append(key).append("':'").append(escaped).append("'");
		}
		
		builder.append("}");
		return builder.toString();
	}
10863
public JsonNode toJsonArray() {
		ArrayNode node = new ObjectMapper().createArrayNode();
		for (String value : getAll()) {
			node.add(value);
		}
		return node;
	}
99339
public String toJson() {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapterFactory(DirectionsAdapterFactory.create());
    gson.registerTypeAdapter(Point.class, new PointAsCoordinatesTypeAdapter());
    return gson.create().toJson(this);
  }
652475
private byte[] toStorageJson() {
    // TODO - precalc how much memory to grab
    final ByteArrayOutputStream output = new ByteArrayOutputStream();
    try {
      final JsonGenerator json = JSON.getFactory().createGenerator(output);
      
      json.writeStartObject();
      
      // we only need to write a small amount of information
      //json.writeNumberField("treeId", tree_id);
      json.writeStringField("name", name);
      json.writeStringField("description", description);
      json.writeStringField("notes", notes);
      json.writeBooleanField("strictMatch", strict_match);
      json.writeNumberField("created", created);
      json.writeBooleanField("enabled", enabled);
      json.writeBooleanField("storeFailures", store_failures);
      json.writeEndObject();
      json.close();
      
      // TODO zero copy?
      return output.toByteArray();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
288
public String asJSON() {
    Gson gson = new Gson();

    clearExpired();

    Cache jsonCache = new Cache();
    for (ExpiringService svc : cache.values()) {
      jsonCache.cache.add(svc.getService());
    }

    String json = gson.toJson(jsonCache);

    return json;
  }
101574
public JSONObject toJSONObject() {
        JSONObject resp = new JSONObject();
        add(resp, URL,url);
        if (secured != null) {
            add(resp, SECURED, secured);
        }
        add(resp, SERVER_VENDOR, serverVendor);
        add(resp, SERVER_PRODUCT, serverProduct);
        add(resp, SERVER_VERSION, serverVersion);
        add(resp, AGENT_VERSION, agentVersion);
        add(resp, AGENT_ID, agentId);
        add(resp, AGENT_DESCRIPTION,agentDescription);
        return resp;
    }
887108
public java.util.List<LogStream> getLogStreams() {
        if (logStreams == null) {
            logStreams = new com.amazonaws.internal.SdkInternalList<LogStream>();
        }
        return logStreams;
    }
669061
@GET
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public List<String> list() {
    return model.getRunningMasters();
  }
986853
public String toJSON() {

        StringBuffer result = new StringBuffer();
        result.append("{\n");
        for (Entry<String, List<String>> simpleEntry : m_simpleAttributes.entrySet()) {
            result.append("\"").append(simpleEntry.getKey()).append("\"").append(": [\n");
            boolean firstValue = true;
            for (String value : simpleEntry.getValue()) {
                if (firstValue) {
                    firstValue = false;
                } else {
                    result.append(",\n");
                }
                result.append("\"").append(value).append("\"");
            }
            result.append("],\n");
        }
        for (Entry<String, List<CmsEntity>> entityEntry : m_entityAttributes.entrySet()) {
            result.append("\"").append(entityEntry.getKey()).append("\"").append(": [\n");
            boolean firstValue = true;
            for (CmsEntity value : entityEntry.getValue()) {
                if (firstValue) {
                    firstValue = false;
                } else {
                    result.append(",\n");
                }
                result.append(value.toJSON());
            }
            result.append("],\n");
        }
        result.append("\"id\": \"").append(m_id).append("\"");
        result.append("}");
        return result.toString();
    }
639875
public static String toJsonAsString() {
        logger.entering();
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        JsonObject configItem = new JsonObject();
        for (Entry<String, Map<String, String>> entry : ReporterConfigMetadata.getReporterMetaData().entrySet()) {
            Map<String, String> subMap = entry.getValue();
            for (Entry<String, String> subEntry : subMap.entrySet()) {
                JsonObject configSubItem = new JsonObject();
                configSubItem.addProperty(subEntry.getKey(), subEntry.getValue());
                configItem.add(entry.getKey(), configSubItem);
            }
        }

        String json = gson.toJson(configItem);
        logger.exiting(json);
        return json;
    }
289187
public String toJSON() {
		StringBuilder json = new StringBuilder();
		json.append("[");
		for (int t = 0; t < components.size(); t++) {
			if (t > 0)
				json.append(",");
			T component = components.get(t);
			json
				.append("{")
				.append("\"label\":\"").append(component.getDisplayName()).append("\"")
				.append(",\"id\":\"").append(component.getId()).append("\"")
				.append("}")
			;
		}
		json.append("]");
		return json.toString();
	}
882704
public List<User> getUsers() {
        Gson gson = gsonParser();
        JsonObject object = (JsonObject) response;
        List<User> l = gson.fromJson(object.get("users"), new TypeToken<List<User>>() {}.getType());
        for (User e : l) { e.setClient(client); }
        return l;
    }
298431
private JSON getJSON() throws JSONMarshallException {
        if (json == null) {
            JSONSettings settings = new JSONSettings(Include.NON_NULL);
            json = JSONFactory.newInstance(settings);
        }
        return json;
    }
108575
public JSONObject getJson() throws JSONException {
        JSONObject json = create();
        json.put("path", eventMessagePattern);
        json.put("handlerClass", eventHandler);
        json.put("routing", isContentRouting ? "content" : "path");
        return json;
    }