addField

fun addField(field: LogField)(source)

Adds the given log field to the log. This is useful when you have a previously constructed field from the field/rawJsonField top-level functions, that you want to add to a single log.

  • If you want to create a new field and add it to the log, you should instead call LogBuilder.field to create the field in-place

  • If you want to add the field to all logs within a scope, you should instead use withLoggingContext