The appender not send my logs to elastic. What's wrong ??
In kibana or quering in elasticsearch doesn't find any index.
In java code using log4j2:
private static final Logger log = LogManager.getLogger(ApplicationMain.class);
XML:
<NoSql name="elasticsearchAppender"> <Elasticsearch url="http://localhost:9200/_bulk" index="'mapeadorrw-'yyyyMMdd" type="log4j2" /> </NoSql> <NoSql name="sfuAppender"> <Elasticsearch url="http://localhost:9200/_bulk" index="'sfu-mapeadorrw-'yyyyMMdd" type="log4j2" /> </NoSql> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="${layout}" /> </Console> .... <Loggers> <logger name="sfu"> <appender-ref ref="sfuAppender" /> </logger> <Root level="TRACE"> <AppenderRef ref="FileProducao" level="INFO" /> <AppenderRef ref="Console" level="TRACE" /> <appender-ref ref="elasticsearchAppender" level="INFO" /> <AppenderRef ref="FileError" level="ERROR" /> </Root> </Loggers>