Skip to content

Commit 0a25106

Browse files
committed
Documentation - IndexTemplate added to config snippets
* IndexTemplate should be added to prevent #9
1 parent 4fe3ce5 commit 0a25106

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ Project consists of:
3737
<Elasticsearch name="elasticsearchAsyncBatch">
3838
<IndexName indexName="log4j2" />
3939
<AsyncBatchDelivery>
40+
<IndexTemplate name="log4j2" path="classpath:indexTemplate.json" />
4041
<JestHttp serverUris="http://localhost:9200" />
4142
</AsyncBatchDelivery>
4243
</Elasticsearch>
4344
</Appenders>
4445
```
4546
or [configure programmatically](https://github.com/rfoltyns/log4j2-elasticsearch/blob/master/log4j2-elasticsearch-jest/src/test/java/org/appenders/log4j2/elasticsearch/jest/smoke/SmokeTest.java)
4647

47-
3. log.info("Hello, World!");
48-
48+
3. Start logging directly to Elasticsearch!
49+
```java
50+
Logger log = LogManager.getLogger("Logger that references elasticsearchAsyncBatch")
51+
log.info("Hello, World!");
52+
```
4953
## Dependencies
5054

5155
Be aware that Jackson FasterXML jars that has to be provided by user for this library to work in default mode.

log4j2-elasticsearch-jest/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Add this snippet to `log4j2.xml` configuration:
2020
<Elasticsearch name="elasticsearchAsyncBatch">
2121
<IndexName indexName="log4j2" />
2222
<AsyncBatchDelivery>
23+
<IndexTemplate name="log4j2" path="classpath:indexTemplate.json" />
2324
<JestHttp serverUris="http://localhost:9200" />
2425
</AsyncBatchDelivery>
2526
</Elasticsearch>

log4j2-elasticsearch2-bulkprocessor/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Add this snippet to `log4j2.xml` configuration:
2020
<Elasticsearch name="elasticsearchAsyncBatch">
2121
<IndexName indexName="log4j2" />
2222
<AsyncBatchDelivery>
23+
<IndexTemplate name="log4j2" path="classpath:indexTemplate.json" />
2324
<ElasticsearchBulkProcessor serverUris="tcp://localhost:9300" />
2425
</AsyncBatchDelivery>
2526
</Elasticsearch>

log4j2-elasticsearch5-bulkprocessor/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Add this snippet to `log4j2.xml` configuration:
2020
<Elasticsearch name="elasticsearchAsyncBatch">
2121
<IndexName indexName="log4j2" />
2222
<AsyncBatchDelivery>
23+
<IndexTemplate name="log4j2" path="classpath:indexTemplate.json" />
2324
<ElasticsearchBulkProcessor serverUris="tcp://localhost:9300" />
2425
</AsyncBatchDelivery>
2526
</Elasticsearch>

log4j2-elasticsearch6-bulkprocessor/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Add this snippet to `log4j2.xml` configuration:
2020
<Elasticsearch name="elasticsearchAsyncBatch">
2121
<IndexName indexName="log4j2" />
2222
<AsyncBatchDelivery>
23+
<IndexTemplate name="log4j2" path="classpath:indexTemplate.json" />
2324
<ElasticsearchBulkProcessor serverUris="tcp://localhost:9300" />
2425
</AsyncBatchDelivery>
2526
</Elasticsearch>

0 commit comments

Comments
 (0)