src/main/java/com/arpnetworking/logback/serialization/steno/StandardSerializationStrategy.java
public String serialize(
        final ILoggingEvent event,
        final String eventName) throws Exception {

        final StringWriter jsonWriter = new StringWriter();
        final JsonGenerator jsonGenerator = _jsonFactory.createGenerator(jsonWriter);

        // Start wrapper
        StenoSerializationHelper.startStenoWrapper(event, eventName, jsonGenerator, _objectMapper);

        // Write event data
        jsonGenerator.writeObjectFieldStart("data");
        jsonGenerator.writeObjectField("message", event.getFormattedMessage());
        jsonGenerator.writeEndObject(); // End 'data' field

        // Output throwable
        StenoSerializationHelper.writeThrowable(event.getThrowableProxy(), jsonGenerator, _objectMapper);

        // End wrapper
        StenoSerializationHelper.endStenoWrapper(event, eventName, jsonGenerator, _objectMapper, _encoder);

        return jsonWriter.toString();
    }
public String serialize(
        final ILoggingEvent event,
        final String eventName) throws Exception {

        final StringWriter jsonWriter = new StringWriter();
        final JsonGenerator jsonGenerator = _jsonFactory.createGenerator(jsonWriter);

        // Start wrapper
        StenoSerializationHelper.startStenoWrapper(event, eventName, jsonGenerator, _objectMapper);

        // Write event data
        jsonGenerator.writeObjectFieldStart("data");
        jsonGenerator.writeObjectField("message", event.getFormattedMessage());
        jsonGenerator.writeEndObject(); // End 'data' field

        // Output throwable
        StenoSerializationHelper.writeThrowable(event.getThrowableProxy(), jsonGenerator, _objectMapper);

        // End wrapper
        StenoSerializationHelper.endStenoWrapper(event, eventName, jsonGenerator, _objectMapper, _encoder);

        return jsonWriter.toString();
    }
public String serialize ( final ILoggingEvent event , final String eventName ) throws Exception { final StringWriter jsonWriter = new StringWriter ( ) ; final JsonGenerator jsonGenerator = _jsonFactory . createGenerator ( jsonWriter ) ; // Start wrapper StenoSerializationHelper . startStenoWrapper ( event , eventName , jsonGenerator , _objectMapper ) ; // Write event data jsonGenerator . writeObjectFieldStart ( "data" ) ; jsonGenerator . writeObjectField ( "message" , event . getFormattedMessage ( ) ) ; jsonGenerator . writeEndObject ( ) ; // End 'data' field // Output throwable StenoSerializationHelper . writeThrowable ( event . getThrowableProxy ( ) , jsonGenerator , _objectMapper ) ; // End wrapper StenoSerializationHelper . endStenoWrapper ( event , eventName , jsonGenerator , _objectMapper , _encoder ) ; return jsonWriter . toString ( ) ; }
Serialize an event.

@param event The event.
@param eventName The event name.
@return Serialization of message as a <code>String</code>.
@throws Exception Serialization may throw any <code>Exception</code>.
Serialize an event .