Search in sources :

Example 1 with EcsLayout

use of co.elastic.logging.log4j2.EcsLayout in project logging-log4j2 by apache.

the class JsonTemplateLayoutBenchmarkState method createEcsLayout.

private static EcsLayout createEcsLayout() {
    final EcsLayout layout = EcsLayout.newBuilder().setConfiguration(CONFIGURATION).setServiceName("benchmark").build();
    final Charset layoutCharset = layout.getCharset();
    // uses UTF-8 internally.
    if (!CHARSET.equals(layoutCharset)) {
        throw new IllegalArgumentException("was expecting EcsLayout charset to be: " + CHARSET + ", found: " + layoutCharset);
    }
    return layout;
}
Also used : Charset(java.nio.charset.Charset) EcsLayout(co.elastic.logging.log4j2.EcsLayout)

Aggregations

EcsLayout (co.elastic.logging.log4j2.EcsLayout)1 Charset (java.nio.charset.Charset)1