如何使用ecslayout在日志输出中打印event.dataset来停止log4j?

ctzwtxfj  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(211)

目前我有以下日志输出。

{"@timestamp":"2020-11-25T11:48:10.443Z", "log.level":"ERROR", "message":"Hallo ", "service.name":"vehicles","event.dataset":"null","process.thread.name":"http-thread-pool::http-listener-1(2)","log.logger":"boundary.MonitoringResource","short.trace.id":"49dcb8d1","trace.id":"49dcb8d1.VEH.UnknownHost-7304"}

我想要相同的输出,但没有event.dataset。
下面是我的log4j配置:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" monitorInterval="1">
  <Appenders>
    <Console name="EcsSystemLogsAppender" target="SYSTEM_OUT">
      <EcsLayout serviceName="vehicles" stackTraceAsArray="true" eventDataset="nullString"></EcsLayout>
    </Console>

  </Appenders>

  <Loggers>

    <Logger name="vehicles" level="error" additivity="false">
          <AppenderRef ref="EcsSystemLogsAppender"/>
    </Logger>

  </Loggers>

</Configuration>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题