lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/api/LogPersister.java
private static JSONObject createJSONObject(final Logger.LEVEL level, final String pkg, final String message, long timestamp, final JSONObject jsonMetadata, final Throwable t) {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put ("timestamp", timestamp);
            jsonObject.put ("level", level.toString());
            jsonObject.put ("pkg", pkg);
            jsonObject.put ("msg", message);
            jsonObject.put ("threadid", Thread.currentThread ().getId());
            if (null != jsonMetadata) {
                jsonObject.put ("metadata", jsonMetadata);
            }
            if (null != t) {
                jsonObject.put ("metadata", appendFullStackTrace(jsonMetadata, t));
            }
        }
        catch (JSONException e) {
            Log.e(LOG_TAG_NAME, "Error adding JSONObject key/value pairs", e);
        }
        return jsonObject;

    }
private static JSONObject createJSONObject(final Logger.LEVEL level, final String pkg, final String message, long timestamp, final JSONObject jsonMetadata, final Throwable t) {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put ("timestamp", timestamp);
            jsonObject.put ("level", level.toString());
            jsonObject.put ("pkg", pkg);
            jsonObject.put ("msg", message);
            jsonObject.put ("threadid", Thread.currentThread ().getId());
            if (null != jsonMetadata) {
                jsonObject.put ("metadata", jsonMetadata);
            }
            if (null != t) {
                jsonObject.put ("metadata", appendFullStackTrace(jsonMetadata, t));
            }
        }
        catch (JSONException e) {
            Log.e(LOG_TAG_NAME, "Error adding JSONObject key/value pairs", e);
        }
        return jsonObject;

    }
Will create JSONObject with the passed parameters, and other relevant information.  See class-level documentation.

@param level
@param message
@param t a Throwable whose stack trace is converted to string and logged, and passed through as-is to android.util.Log
@return a JSONObject as shown in the class introduction