internetitem / logback-elasticsearch-appender

Logback Elasticsearch Appender
Other
233 stars 137 forks source link

Does not support elasticsearch aliases? #88

Open x4team opened 2 years ago

x4team commented 2 years ago

There is such a configuration in the application

` <appender name="ELASTIC" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">

${elasticURL}/_bulk
    <index>service-logs-${springProfile}</index>
    <type>entry</type>
    <!--        <errorLoggerName>es-error-logger</errorLoggerName> &lt;!&ndash; optional &ndash;&gt;-->
    <connectTimeout>2000</connectTimeout> <!-- optional (in ms, default 30000) -->
    <errorsToStderr>false</errorsToStderr> <!-- optional (default false) -->
    <includeCallerData>false</includeCallerData> <!-- optional (default false) -->
    <logsToStderr>false</logsToStderr> <!-- optional (default false) -->
    <maxQueueSize>104857600</maxQueueSize> <!-- optional (default 104857600) -->
    <maxRetries>3</maxRetries> <!-- optional (default 3) -->
    <readTimeout>15000</readTimeout> <!-- optional (in ms, default 30000) -->
    <sleepTime>5000</sleepTime> <!-- optional (in ms, default 250) -->
    <rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
    <includeMdc>false</includeMdc> <!-- optional (default false) -->`

By default, the service-logs-dev index is used. I deleted it and created a shared service-logs index for which I assigned the alias service-logs-dev. As a result, I tested writing the document to the index using the service-logs-dev alias, everything was successful. But the application refuses to write logs by alias. Only if I specify a specific index. So appender doesn't work with aliases? Thanks for the help