接口 StructuredLogFormatter<E>

类型参数:
E - the log event type
所有已知实现类:
JsonWriterStructuredLogFormatter
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface StructuredLogFormatter<E>
Formats a log event to a structured log message.

Implementing classes can declare the following parameter types in the constructor:

When using Logback, implementing classes can also use the following parameter types in the constructor:
  • ThrowableProxyConverter
从以下版本开始:
3.4.0
作者:
Moritz Halbritter
  • 方法概要

    修饰符和类型
    方法
    说明
    format(E event)
    Formats the given log event to a String.
    default byte[]
    formatAsBytes(E event, Charset charset)
    Formats the given log event to a byte array.
  • 方法详细资料

    • format

      String format(E event)
      Formats the given log event to a String.
      参数:
      event - the log event to write
      返回:
      the formatted log event String
    • formatAsBytes

      default byte[] formatAsBytes(E event, Charset charset)
      Formats the given log event to a byte array.
      参数:
      event - the log event to write
      charset - the charset
      返回:
      the formatted log event bytes