14 Mart 2023 Salı

Log4j2 log4j2.xml FileAppender Tanımlama

Örnek
Şöyle yaparız
<Configuration name="LogToConsole" target="SYSTEM_OUT">
  <Appenders>
    <File name="FileAppender" fileName="logs/app.log.json">
      <EcsLayout serviceName="my-app"/>
    </File>
  </Appenders>

  <Loggers>
    <Root>
      <AppenderRef ref="FileAppender" />
    </Root>
    <Logger name="none.rks.Main" level="debug" additivity="false">
      <AppenderRef ref="FileAppender" />
    </Logger>
  </Loggers>
</Configuration>

Hiç yorum yok:

Yorum Gönder