Interface StructuredArgument
public interface StructuredArgument
A wrapper for an argument passed to a log method (e.g.
Logger.info(String, Object...))
that adds data to the JSON event.-
Method Summary
Modifier and TypeMethodDescriptiontoString()Writes the data associated with this argument to aStringto be included in a log event's formatted message (via parameter substitution).voidwriteTo(JsonSerializer serializer) Writes the data associated with this argument to the givenJsonSerializer.
-
Method Details
-
writeTo
Writes the data associated with this argument to the givenJsonSerializer.- Parameters:
serializer- theJsonSerializerto produce JSON content- Throws:
IOException- if an I/O error occurs
-
toString
String toString()Writes the data associated with this argument to aStringto be included in a log event's formatted message (via parameter substitution).Note that this will only be included in the log event's formatted message if the message format includes a parameter for this argument (using {}).
-