@Override
	public String format(LoggingEvent event) {
		info = event.getLocationInformation();
		fieldData = new HashMap<String, Object>();
		exceptionInformation = new HashMap<String, Object>();
		mdc = event.getProperties();
		ndc = event.getNDC();

		JsonLogObj obj = new JsonLogObj();
		obj.setHostname(Utils.getHostName());
		obj.setMsg(event.getRenderedMessage());
		obj.setTimestamp(event.getTimeStamp());
		obj.setThread(event.getThreadName());
		if (event.getThrowableInformation() != null) {
			final ThrowableInformation throwableInformation = event.getThrowableInformation();
			if (throwableInformation.getThrowable().getClass().getCanonicalName() != null) {
				exceptionInformation.put("exception_class",throwableInformation.getThrowable().getClass().getCanonicalName());
			}
			if (throwableInformation.getThrowable().getMessage() != null) {
				exceptionInformation.put("exception_message",throwableInformation.getThrowable().getMessage());
			}
			if (throwableInformation.getThrowableStrRep() != null) {
				String stackTrace = StringUtils.join(throwableInformation.getThrowableStrRep(), "\n");
				exceptionInformation.put("stacktrace", stackTrace);
			}
			addFieldData("exception", exceptionInformation);
		}

		if (event.locationInformationExists()) {
			info = event.getLocationInformation();
			addFieldData("file", info.getFileName());
			addFieldData("line_number", info.getLineNumber());
			addFieldData("class", info.getClassName());
			addFieldData("method", info.getMethodName());
		}

		addFieldData("mdc", mdc);
		addFieldData("ndc", ndc);
		addFieldData("level", event.getLevel().toString());

		obj.setExceptionInformation(exceptionInformation);
		obj.setFieldData(fieldData);
		return gson.toJson(obj);
	}