internetitem / logback-elasticsearch-appender Goto Github PK
View Code? Open in Web Editor NEWLogback Elasticsearch Appender
License: Other
Logback Elasticsearch Appender
License: Other
As title, does logback-elasticsearch-appender suport TTL?
We don't need to save all logs and I can't find any attribute related to doc or index TTL.
I would like to use this appender with the LogstashEncoder (net.logstash.logback.encoder.LogstashEncoder)
Do you think it is feasible to modify the code to support an encoder (ch.qos.logback.core.encoder.Encoder) for formatting the output? Is this sensible?
Not a huge thing, but if I configure an appender with rawJsonMessage = true, and then log a message that isn't JSON, ES baulks at the write, but the message is left in the queue as if it had suffered a plain old IOException. So the bad message will be retried every time, effectively blocking any further logging.
Ah, the law of unintended consequences ;-)
ElasticsearchWriter.
This if doesn't work any more cause ES always returns http 200. elastic/elasticsearch#18978
if (rc != 200) {
String data = slurpErrors(urlConnection);
throw new IOException("Got response code [" + rc + "] from server with data " + data);
}
Need to inspect json response for {status:400}, etc... end error:"err text".
Support something similar to what logstash-logback-encoder offers, namely "Structured arguments", which allow easy adding of fields to your documents sent to Elasticsearch.
This is already possible when putting fields into the MDC with the correct encoder, but populating and then clearing the MDC is cumbersome.
Sample usage:
LOG.debug("Rendering took {} ms for {}", StructuredArguments.value("duration.ms", durationMs), StructuredArguments.keyValue("username", "userid"));
(Might be related to #31)
elasticsearch6.2 do not support POST request
Failover Appener in case Elasticsearch server is unreachable after maxRetries, preferrably to console/STDOUT
I used this configuration:
<appender name="ELASTIC" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>http://localhost:9200/_bulk</url>
<index>fouras-logs-%date{yyyy-MM-dd}</index>
<type>log</type>
<loggerName>es-logger</loggerName> <!-- optional -->
<errorLoggerName>es-error-logger</errorLoggerName> <!-- optional -->
<connectTimeout>30000</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>30000</readTimeout> <!-- optional (in ms, default 30000) -->
<sleepTime>250</sleepTime> <!-- optional (in ms, default 250) -->
<rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
<properties>
<property>
<name>host</name>
<value>${HOSTNAME}</value>
<allowEmpty>false</allowEmpty>
</property>
<property>
<name>severity</name>
<value>%level</value>
</property>
<property>
<name>thread</name>
<value>%thread</value>
</property>
<property>
<name>stacktrace</name>
<value>%ex</value>
</property>
<property>
<name>logger</name>
<value>%logger</value>
</property>
</properties>
<headers>
<header>
<name>Content-Type</name>
<value>text/plain</value>
</header>
</headers>
</appender>
<logger name="com.datcom.fouras" level="TRACE">
<appender-ref ref="ELASTIC"/>
</logger>
But, when running i get this error with the following stacktrace:
/usr/lib/jvm/java-8-oracle/bin/java -Didea.launcher.port=7534 -Didea.launcher.bin.path=/home/fathi/Documents/Softs/Intellij/idea-IU-143.2287.1/bin -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/deploy.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-oracle/jre/lib/javaws.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfxswt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar:/usr/lib/jvm/java-8-oracle/jre/lib/plugin.jar:/usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/home/fathi/IdeaProjects/fouras/target/classes:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-redis/1.3.2.RELEASE/spring-boot-starter-redis-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/data/spring-data-redis/1.6.2.RELEASE/spring-data-redis-1.6.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-context/4.2.4.RELEASE/spring-context-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-context-support/4.2.4.RELEASE/spring-context-support-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-aop/4.2.4.RELEASE/spring-aop-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/home/fathi/.m2/repository/org/slf4j/slf4j-api/1.7.13/slf4j-api-1.7.13.jar:/home/fathi/.m2/repository/redis/clients/jedis/2.7.3/jedis-2.7.3.jar:/home/fathi/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-data-elasticsearch/1.3.2.RELEASE/spring-boot-starter-data-elasticsearch-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/data/spring-data-elasticsearch/1.3.2.RELEASE/spring-data-elasticsearch-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/data/spring-data-commons/1.11.2.RELEASE/spring-data-commons-1.11.2.RELEASE.jar:/home/fathi/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/home/fathi/.m2/repository/joda-time/joda-time/2.8.2/joda-time-2.8.2.jar:/home/fathi/.m2/repository/org/elasticsearch/elasticsearch/1.5.2/elasticsearch-1.5.2.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-core/4.10.4/lucene-core-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-analyzers-common/4.10.4/lucene-analyzers-common-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-queries/4.10.4/lucene-queries-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-memory/4.10.4/lucene-memory-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-highlighter/4.10.4/lucene-highlighter-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-queryparser/4.10.4/lucene-queryparser-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-sandbox/4.10.4/lucene-sandbox-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-suggest/4.10.4/lucene-suggest-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-misc/4.10.4/lucene-misc-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-join/4.10.4/lucene-join-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-grouping/4.10.4/lucene-grouping-4.10.4.jar:/home/fathi/.m2/repository/org/apache/lucene/lucene-spatial/4.10.4/lucene-spatial-4.10.4.jar:/home/fathi/.m2/repository/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1.jar:/home/fathi/.m2/repository/org/antlr/antlr-runtime/3.5/antlr-runtime-3.5.jar:/home/fathi/.m2/repository/org/ow2/asm/asm/4.1/asm-4.1.jar:/home/fathi/.m2/repository/org/ow2/asm/asm-commons/4.1/asm-commons-4.1.jar:/home/fathi/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.13/jcl-over-slf4j-1.7.13.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/1.3.2.RELEASE/spring-boot-starter-data-jpa-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-aop/1.3.2.RELEASE/spring-boot-starter-aop-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/aspectj/aspectjweaver/1.8.8/aspectjweaver-1.8.8.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/1.3.2.RELEASE/spring-boot-starter-jdbc-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/apache/tomcat/tomcat-jdbc/8.0.30/tomcat-jdbc-8.0.30.jar:/home/fathi/.m2/repository/org/apache/tomcat/tomcat-juli/8.0.30/tomcat-juli-8.0.30.jar:/home/fathi/.m2/repository/org/hibernate/hibernate-entitymanager/4.3.11.Final/hibernate-entitymanager-4.3.11.Final.jar:/home/fathi/.m2/repository/org/hibernate/hibernate-core/4.3.11.Final/hibernate-core-4.3.11.Final.jar:/home/fathi/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/home/fathi/.m2/repository/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final.jar:/home/fathi/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/fathi/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/home/fathi/.m2/repository/org/hibernate/common/hibernate-commons-annotations/4.0.5.Final/hibernate-commons-annotations-4.0.5.Final.jar:/home/fathi/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar:/home/fathi/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar:/home/fathi/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar:/home/fathi/.m2/repository/org/springframework/data/spring-data-jpa/1.9.2.RELEASE/spring-data-jpa-1.9.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-orm/4.2.4.RELEASE/spring-orm-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-aspects/4.2.4.RELEASE/spring-aspects-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-data-rest/1.3.2.RELEASE/spring-boot-starter-data-rest-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.5/jackson-annotations-2.6.5.jar:/home/fathi/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.5/jackson-databind-2.6.5.jar:/home/fathi/.m2/repository/org/springframework/data/spring-data-rest-webmvc/2.4.2.RELEASE/spring-data-rest-webmvc-2.4.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/data/spring-data-rest-core/2.4.2.RELEASE/spring-data-rest-core-2.4.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/hateoas/spring-hateoas/0.19.0.RELEASE/spring-hateoas-0.19.0.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar:/home/fathi/.m2/repository/org/atteo/evo-inflector/1.2.1/evo-inflector-1.2.1.jar:/home/fathi/.m2/repository/com/github/fge/json-patch/1.7/json-patch-1.7.jar:/home/fathi/.m2/repository/com/github/fge/jackson-coreutils/1.6/jackson-coreutils-1.6.jar:/home/fathi/.m2/repository/com/github/fge/msg-simple/1.1/msg-simple-1.1.jar:/home/fathi/.m2/repository/com/github/fge/btf/1.2/btf-1.2.jar:/home/fathi/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar:/home/fathi/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.2.RELEASE/spring-boot-starter-tomcat-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.30/tomcat-embed-core-8.0.30.jar:/home/fathi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.30/tomcat-embed-el-8.0.30.jar:/home/fathi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.30/tomcat-embed-logging-juli-8.0.30.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.2.RELEASE/spring-boot-starter-validation-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/hibernate/hibernate-validator/5.2.2.Final/hibernate-validator-5.2.2.Final.jar:/home/fathi/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar:/home/fathi/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar:/home/fathi/.m2/repository/org/springframework/spring-web/4.2.4.RELEASE/spring-web-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-webmvc/4.2.4.RELEASE/spring-webmvc-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-expression/4.2.4.RELEASE/spring-expression-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar:/home/fathi/.m2/repository/org/apache/commons/commons-email/1.2/commons-email-1.2.jar:/home/fathi/.m2/repository/javax/mail/mail/1.4.1/mail-1.4.1.jar:/home/fathi/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/home/fathi/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar:/home/fathi/.m2/repository/com/cwbase/logback-redis-appender/1.1.5/logback-redis-appender-1.1.5.jar:/home/fathi/.m2/repository/net/logstash/logback/logstash-logback-encoder/4.7/logstash-logback-encoder-4.7.jar:/home/fathi/.m2/repository/ch/qos/logback/logback-access/1.1.3/logback-access-1.1.3.jar:/home/fathi/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar:/home/fathi/.m2/repository/com/internetitem/logback-elasticsearch-appender/1.2/logback-elasticsearch-appender-1.2.jar:/home/fathi/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.5/jackson-core-2.6.5.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.2.RELEASE/spring-boot-starter-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot/1.3.2.RELEASE/spring-boot-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.2.RELEASE/spring-boot-starter-logging-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar:/home/fathi/.m2/repository/org/slf4j/jul-to-slf4j/1.7.13/jul-to-slf4j-1.7.13.jar:/home/fathi/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.13/log4j-over-slf4j-1.7.13.jar:/home/fathi/.m2/repository/org/springframework/spring-core/4.2.4.RELEASE/spring-core-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar:/home/fathi/.m2/repository/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar:/home/fathi/.m2/repository/org/hibernate/hibernate-jpamodelgen/4.3.11.Final/hibernate-jpamodelgen-4.3.11.Final.jar:/home/fathi/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar:/home/fathi/.m2/repository/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-undertow/1.3.2.RELEASE/spring-boot-starter-undertow-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/io/undertow/undertow-core/1.3.14.Final/undertow-core-1.3.14.Final.jar:/home/fathi/.m2/repository/org/jboss/xnio/xnio-api/3.3.4.Final/xnio-api-3.3.4.Final.jar:/home/fathi/.m2/repository/org/jboss/xnio/xnio-nio/3.3.4.Final/xnio-nio-3.3.4.Final.jar:/home/fathi/.m2/repository/io/undertow/undertow-servlet/1.3.14.Final/undertow-servlet-1.3.14.Final.jar:/home/fathi/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.2_spec/1.0.0.Final/jboss-annotations-api_1.2_spec-1.0.0.Final.jar:/home/fathi/.m2/repository/io/undertow/undertow-websockets-jsr/1.3.14.Final/undertow-websockets-jsr-1.3.14.Final.jar:/home/fathi/.m2/repository/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec/1.1.0.Final/jboss-websocket-api_1.1_spec-1.1.0.Final.jar:/home/fathi/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar:/home/fathi/.m2/repository/org/glassfish/javax.el/3.0.0/javax.el-3.0.0.jar:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-thymeleaf/1.3.2.RELEASE/spring-boot-starter-thymeleaf-1.3.2.RELEASE.jar:/home/fathi/.m2/repository/org/thymeleaf/thymeleaf-spring4/2.1.4.RELEASE/thymeleaf-spring4-2.1.4.RELEASE.jar:/home/fathi/.m2/repository/org/thymeleaf/thymeleaf/2.1.4.RELEASE/thymeleaf-2.1.4.RELEASE.jar:/home/fathi/.m2/repository/ognl/ognl/3.0.8/ognl-3.0.8.jar:/home/fathi/.m2/repository/org/unbescape/unbescape/1.1.0.RELEASE/unbescape-1.1.0.RELEASE.jar:/home/fathi/.m2/repository/nz/net/ultraq/thymeleaf/thymeleaf-layout-dialect/1.3.1/thymeleaf-layout-dialect-1.3.1.jar:/home/fathi/.m2/repository/org/codehaus/groovy/groovy/2.4.4/groovy-2.4.4.jar:/home/fathi/.m2/repository/org/springframework/spring-jdbc/4.2.4.RELEASE/spring-jdbc-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-beans/4.2.4.RELEASE/spring-beans-4.2.4.RELEASE.jar:/home/fathi/.m2/repository/org/springframework/spring-tx/4.2.4.RELEASE/spring-tx-4.2.4.RELEASE.jar:/home/fathi/Documents/Softs/Intellij/idea-IU-143.2287.1/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain com.datcom.fouras.FourasApplication --spring.output.ansi.enabled=always
Logging system failed to initialize using configuration from 'logback.xml'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:25 - no applicable action for [errorsToStdErr], current ElementPath is [[configuration][appender][errorsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:23 - no applicable action for [logsToStdErr], current ElementPath is [[configuration][appender][logsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:25 - no applicable action for [rawJsonMessage], current ElementPath is [[configuration][appender][rawJsonMessage]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:18 - no applicable action for [headers], current ElementPath is [[configuration][appender][headers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@55:21 - no applicable action for [header], current ElementPath is [[configuration][appender][headers][header]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:24 - no applicable action for [value], current ElementPath is [[configuration][appender][headers][header][value]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:56)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:46)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:267)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.datcom.fouras.FourasApplication.main(FourasApplication.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
[2016-05-22 12:37:34:697 main ERROR org.springframework.boot.SpringApplication - Application startup failed]
java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:25 - no applicable action for [errorsToStdErr], current ElementPath is [[configuration][appender][errorsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:23 - no applicable action for [logsToStdErr], current ElementPath is [[configuration][appender][logsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:25 - no applicable action for [rawJsonMessage], current ElementPath is [[configuration][appender][rawJsonMessage]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:18 - no applicable action for [headers], current ElementPath is [[configuration][appender][headers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@55:21 - no applicable action for [header], current ElementPath is [[configuration][appender][headers][header]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:24 - no applicable action for [value], current ElementPath is [[configuration][appender][headers][header][value]]
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:274) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at com.datcom.fouras.FourasApplication.main(FourasApplication.java:22) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) [idea_rt.jar:na]
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:25 - no applicable action for [errorsToStdErr], current ElementPath is [[configuration][appender][errorsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:23 - no applicable action for [logsToStdErr], current ElementPath is [[configuration][appender][logsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:25 - no applicable action for [rawJsonMessage], current ElementPath is [[configuration][appender][rawJsonMessage]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:18 - no applicable action for [headers], current ElementPath is [[configuration][appender][headers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@55:21 - no applicable action for [header], current ElementPath is [[configuration][appender][headers][header]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:24 - no applicable action for [value], current ElementPath is [[configuration][appender][headers][header][value]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:56) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:46) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:267) ~[spring-boot-1.3.2.RELEASE.jar:1.3.2.RELEASE]
... 19 common frames omitted
Exception in thread "main" java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:25 - no applicable action for [errorsToStdErr], current ElementPath is [[configuration][appender][errorsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:23 - no applicable action for [logsToStdErr], current ElementPath is [[configuration][appender][logsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:25 - no applicable action for [rawJsonMessage], current ElementPath is [[configuration][appender][rawJsonMessage]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:18 - no applicable action for [headers], current ElementPath is [[configuration][appender][headers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@55:21 - no applicable action for [header], current ElementPath is [[configuration][appender][headers][header]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:24 - no applicable action for [value], current ElementPath is [[configuration][appender][headers][header][value]]
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:274)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.datcom.fouras.FourasApplication.main(FourasApplication.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:25 - no applicable action for [errorsToStdErr], current ElementPath is [[configuration][appender][errorsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:23 - no applicable action for [logsToStdErr], current ElementPath is [[configuration][appender][logsToStdErr]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:25 - no applicable action for [rawJsonMessage], current ElementPath is [[configuration][appender][rawJsonMessage]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@54:18 - no applicable action for [headers], current ElementPath is [[configuration][appender][headers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@55:21 - no applicable action for [header], current ElementPath is [[configuration][appender][headers][header]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:24 - no applicable action for [value], current ElementPath is [[configuration][appender][headers][header][value]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:56)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:46)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:267)
... 19 more[2016-05-22 12:37:34:714 main INFO org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/deploy.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/cldrdata.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jaccess.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/nashorn.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunec.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunjce_provider.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunpkcs11.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipfs.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/javaws.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/jfxswt.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/plugin.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/resources.jar, file:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar, file:/home/fathi/IdeaProjects/fouras/target/classes/, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-redis/1.3.2.RELEASE/spring-boot-starter-redis-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/data/spring-data-redis/1.6.2.RELEASE/spring-data-redis-1.6.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-context/4.2.4.RELEASE/spring-context-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-context-support/4.2.4.RELEASE/spring-context-support-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-aop/4.2.4.RELEASE/spring-aop-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/home/fathi/.m2/repository/org/slf4j/slf4j-api/1.7.13/slf4j-api-1.7.13.jar, file:/home/fathi/.m2/repository/redis/clients/jedis/2.7.3/jedis-2.7.3.jar, file:/home/fathi/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-data-elasticsearch/1.3.2.RELEASE/spring-boot-starter-data-elasticsearch-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/data/spring-data-elasticsearch/1.3.2.RELEASE/spring-data-elasticsearch-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/data/spring-data-commons/1.11.2.RELEASE/spring-data-commons-1.11.2.RELEASE.jar, file:/home/fathi/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/home/fathi/.m2/repository/joda-time/joda-time/2.8.2/joda-time-2.8.2.jar, file:/home/fathi/.m2/repository/org/elasticsearch/elasticsearch/1.5.2/elasticsearch-1.5.2.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-core/4.10.4/lucene-core-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-analyzers-common/4.10.4/lucene-analyzers-common-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-queries/4.10.4/lucene-queries-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-memory/4.10.4/lucene-memory-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-highlighter/4.10.4/lucene-highlighter-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-queryparser/4.10.4/lucene-queryparser-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-sandbox/4.10.4/lucene-sandbox-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-suggest/4.10.4/lucene-suggest-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-misc/4.10.4/lucene-misc-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-join/4.10.4/lucene-join-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-grouping/4.10.4/lucene-grouping-4.10.4.jar, file:/home/fathi/.m2/repository/org/apache/lucene/lucene-spatial/4.10.4/lucene-spatial-4.10.4.jar, file:/home/fathi/.m2/repository/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1.jar, file:/home/fathi/.m2/repository/org/antlr/antlr-runtime/3.5/antlr-runtime-3.5.jar, file:/home/fathi/.m2/repository/org/ow2/asm/asm/4.1/asm-4.1.jar, file:/home/fathi/.m2/repository/org/ow2/asm/asm-commons/4.1/asm-commons-4.1.jar, file:/home/fathi/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.13/jcl-over-slf4j-1.7.13.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/1.3.2.RELEASE/spring-boot-starter-data-jpa-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-aop/1.3.2.RELEASE/spring-boot-starter-aop-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/aspectj/aspectjweaver/1.8.8/aspectjweaver-1.8.8.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/1.3.2.RELEASE/spring-boot-starter-jdbc-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/apache/tomcat/tomcat-jdbc/8.0.30/tomcat-jdbc-8.0.30.jar, file:/home/fathi/.m2/repository/org/apache/tomcat/tomcat-juli/8.0.30/tomcat-juli-8.0.30.jar, file:/home/fathi/.m2/repository/org/hibernate/hibernate-entitymanager/4.3.11.Final/hibernate-entitymanager-4.3.11.Final.jar, file:/home/fathi/.m2/repository/org/hibernate/hibernate-core/4.3.11.Final/hibernate-core-4.3.11.Final.jar, file:/home/fathi/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/home/fathi/.m2/repository/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final.jar, file:/home/fathi/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar, file:/home/fathi/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar, file:/home/fathi/.m2/repository/org/hibernate/common/hibernate-commons-annotations/4.0.5.Final/hibernate-commons-annotations-4.0.5.Final.jar, file:/home/fathi/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar, file:/home/fathi/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar, file:/home/fathi/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar, file:/home/fathi/.m2/repository/org/springframework/data/spring-data-jpa/1.9.2.RELEASE/spring-data-jpa-1.9.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-orm/4.2.4.RELEASE/spring-orm-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-aspects/4.2.4.RELEASE/spring-aspects-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-data-rest/1.3.2.RELEASE/spring-boot-starter-data-rest-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.5/jackson-annotations-2.6.5.jar, file:/home/fathi/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.5/jackson-databind-2.6.5.jar, file:/home/fathi/.m2/repository/org/springframework/data/spring-data-rest-webmvc/2.4.2.RELEASE/spring-data-rest-webmvc-2.4.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/data/spring-data-rest-core/2.4.2.RELEASE/spring-data-rest-core-2.4.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/hateoas/spring-hateoas/0.19.0.RELEASE/spring-hateoas-0.19.0.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar, file:/home/fathi/.m2/repository/org/atteo/evo-inflector/1.2.1/evo-inflector-1.2.1.jar, file:/home/fathi/.m2/repository/com/github/fge/json-patch/1.7/json-patch-1.7.jar, file:/home/fathi/.m2/repository/com/github/fge/jackson-coreutils/1.6/jackson-coreutils-1.6.jar, file:/home/fathi/.m2/repository/com/github/fge/msg-simple/1.1/msg-simple-1.1.jar, file:/home/fathi/.m2/repository/com/github/fge/btf/1.2/btf-1.2.jar, file:/home/fathi/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar, file:/home/fathi/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.2.RELEASE/spring-boot-starter-web-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.2.RELEASE/spring-boot-starter-tomcat-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.30/tomcat-embed-core-8.0.30.jar, file:/home/fathi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.30/tomcat-embed-el-8.0.30.jar, file:/home/fathi/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.30/tomcat-embed-logging-juli-8.0.30.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.2.RELEASE/spring-boot-starter-validation-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/hibernate/hibernate-validator/5.2.2.Final/hibernate-validator-5.2.2.Final.jar, file:/home/fathi/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/home/fathi/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar, file:/home/fathi/.m2/repository/org/springframework/spring-web/4.2.4.RELEASE/spring-web-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-webmvc/4.2.4.RELEASE/spring-webmvc-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-expression/4.2.4.RELEASE/spring-expression-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar, file:/home/fathi/.m2/repository/org/apache/commons/commons-email/1.2/commons-email-1.2.jar, file:/home/fathi/.m2/repository/javax/mail/mail/1.4.1/mail-1.4.1.jar, file:/home/fathi/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar, file:/home/fathi/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar, file:/home/fathi/.m2/repository/com/cwbase/logback-redis-appender/1.1.5/logback-redis-appender-1.1.5.jar, file:/home/fathi/.m2/repository/net/logstash/logback/logstash-logback-encoder/4.7/logstash-logback-encoder-4.7.jar, file:/home/fathi/.m2/repository/ch/qos/logback/logback-access/1.1.3/logback-access-1.1.3.jar, file:/home/fathi/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar, file:/home/fathi/.m2/repository/com/internetitem/logback-elasticsearch-appender/1.2/logback-elasticsearch-appender-1.2.jar, file:/home/fathi/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.5/jackson-core-2.6.5.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.2.RELEASE/spring-boot-starter-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot/1.3.2.RELEASE/spring-boot-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.2.RELEASE/spring-boot-autoconfigure-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.2.RELEASE/spring-boot-starter-logging-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar, file:/home/fathi/.m2/repository/org/slf4j/jul-to-slf4j/1.7.13/jul-to-slf4j-1.7.13.jar, file:/home/fathi/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.13/log4j-over-slf4j-1.7.13.jar, file:/home/fathi/.m2/repository/org/springframework/spring-core/4.2.4.RELEASE/spring-core-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/home/fathi/.m2/repository/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar, file:/home/fathi/.m2/repository/org/hibernate/hibernate-jpamodelgen/4.3.11.Final/hibernate-jpamodelgen-4.3.11.Final.jar, file:/home/fathi/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/home/fathi/.m2/repository/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-undertow/1.3.2.RELEASE/spring-boot-starter-undertow-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/io/undertow/undertow-core/1.3.14.Final/undertow-core-1.3.14.Final.jar, file:/home/fathi/.m2/repository/org/jboss/xnio/xnio-api/3.3.4.Final/xnio-api-3.3.4.Final.jar, file:/home/fathi/.m2/repository/org/jboss/xnio/xnio-nio/3.3.4.Final/xnio-nio-3.3.4.Final.jar, file:/home/fathi/.m2/repository/io/undertow/undertow-servlet/1.3.14.Final/undertow-servlet-1.3.14.Final.jar, file:/home/fathi/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.2_spec/1.0.0.Final/jboss-annotations-api_1.2_spec-1.0.0.Final.jar, file:/home/fathi/.m2/repository/io/undertow/undertow-websockets-jsr/1.3.14.Final/undertow-websockets-jsr-1.3.14.Final.jar, file:/home/fathi/.m2/repository/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec/1.1.0.Final/jboss-websocket-api_1.1_spec-1.1.0.Final.jar, file:/home/fathi/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar, file:/home/fathi/.m2/repository/org/glassfish/javax.el/3.0.0/javax.el-3.0.0.jar, file:/home/fathi/.m2/repository/org/springframework/boot/spring-boot-starter-thymeleaf/1.3.2.RELEASE/spring-boot-starter-thymeleaf-1.3.2.RELEASE.jar, file:/home/fathi/.m2/repository/org/thymeleaf/thymeleaf-spring4/2.1.4.RELEASE/thymeleaf-spring4-2.1.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/thymeleaf/thymeleaf/2.1.4.RELEASE/thymeleaf-2.1.4.RELEASE.jar, file:/home/fathi/.m2/repository/ognl/ognl/3.0.8/ognl-3.0.8.jar, file:/home/fathi/.m2/repository/org/unbescape/unbescape/1.1.0.RELEASE/unbescape-1.1.0.RELEASE.jar, file:/home/fathi/.m2/repository/nz/net/ultraq/thymeleaf/thymeleaf-layout-dialect/1.3.1/thymeleaf-layout-dialect-1.3.1.jar, file:/home/fathi/.m2/repository/org/codehaus/groovy/groovy/2.4.4/groovy-2.4.4.jar, file:/home/fathi/.m2/repository/org/springframework/spring-jdbc/4.2.4.RELEASE/spring-jdbc-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-beans/4.2.4.RELEASE/spring-beans-4.2.4.RELEASE.jar, file:/home/fathi/.m2/repository/org/springframework/spring-tx/4.2.4.RELEASE/spring-tx-4.2.4.RELEASE.jar, file:/home/fathi/Documents/Softs/Intellij/idea-IU-143.2287.1/lib/idea_rt.jar]]
Multiple threads are modifying the same instance of a StringBuilder(Buffer), the result are unexpected : some modifications are lost
We make heavy use of this appender in a production environment with multiple instances of micro-services running across a cluster. Having all the micro-service instances log in near real-time directly into Elasticsearch has become core functionality. However, unless we have missed something, the granularity of @timestamp is second. As we have many threads running in many micro-services that level of granularity is not enough for us to get a sequenced set of events when we are exploring an issue. We need at least millisecond granularity to sequence the log events correctly. Is there some way we can change the granularity of @timestamp to millisecond? Thanks enormously for a great tool!
I saw sendData()
in ElasticsearchWriter
class, every invoke create a new HttpURLConnection. So I wonder if it will open too many http connection to elasticsearch.
Thanks!
Hi,
I have made a few improvements on the appender:
I have not seen much activity in the repo lately though. To the original maintainers, are you guys still there? And if so, do you have plans for a 1.7 release?
Best,
Like RollingFileAppender, the logs data will become bigger and bigger if we do not delete the old indexes, but i can not file a config in the doc that allow me to do the delete operation.
See PR #72
If you want to add another properties such as "isSuccess", "calulationTime" etc.
Thank you for project!
I would like to send logs by next structure:
{
"event": {
"severity": "INFO",
"message": {
"correlationId": "9df8d06b7d3f0c42bf2d81fbc976a6c1",
"system": "WebApi"
}
}
}
And I send logs like this:
<appender name="ELASTIC" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>http://localhost:9200/_bulk</url>
<index>logs</index>
<properties>
<property>
<name>event</name>
<value>
<property>
<name>severity</name>
<value>%level</value>
</property>
<property>
<name>message</name>
<value>
<property>
<name>correlationId</name>
<value>correlationId</value>
</property>
<property>
<name>system</name>
<value>system</value>
</property>
</value>
</property>
</value>
</property>
</properties>
<headers>
<header>
<name>Content-Type</name>
<value>application/json</value>
</header>
</headers>
</appender>
I get the next error
ERROR in ch.qos.logback.core.joran.spi.Interpreter@45:18 - no applicable action for [property], current ElementPath is [[configuration][appender][properties][property][value][property][value][property]]
I think, this is incorrect approach. How can I do it?
Use case - without _id field each log event reentry will add a new record in the db.
I'd prefer to have one file copy of logs and one imported to ES. If ES crashes, I need ability to reimport some log files to the the ES manually. To do this I need log event ID field.
Every user can define it's own UUID generation mechanizm based on indexed data. The only part I'm missing is that private serializeIndexString() in AbstractElasticsearchPublisher doesn't leave any options to add
_id : "myid" to the indexed data. Thais can be done either by making serializeEvents() or serializeIndexString() protected, or by providing additional configuration like:
IdGenerator idGenerator = settings.getIdGenerator();
if (idGenerator != null) {
gen.writeObjectField("_id", idGenerator.generateId(event));
}
Hi,
I have a play project and I want to use this library to publish events to Amazon elasticsearch.
Added the reference to it to mt build.sbt as: "com.internetitem" % "logback-elasticsearch-appender" % "1.4"
I tried to add a new authentication class in my project, say the full name is: utils.AWSUtils.AmazonElasticSearchAuthentication,
I then put this in the appender configuration as:
when running the server I receive the following exception:
ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not create component [authentication] of type [utils.AWSUtils.AmazonElasticSearchAuthentication] java.lang.ClassNotFoundException: utils.AWSUtils.AmazonElasticSearchAuthentication
at java.lang.ClassNotFoundException: utils.AWSUtils.AmazonElasticSearchAuthentication
at at java.net.URLClassLoader.findClass(URLClassLoader.)
at at java.lang.ClassLoader.loadClass(ClassLoader.)
at at java.lang.ClassLoader.loadClass(ClassLoader.)
at at ch.qos.logback.core.util.Loader.loadClass(Loader.)
at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.begin(NestedComplexPropertyIA.)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at play.api.Logger$.configure(Logger.)
at at play.api.Logger$.configure(Logger.)
at at play.api.inject.guice.GuiceApplicationBuilder.applicationModule(GuiceApplicationBuilder.scala:73)
at at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.)
at at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
at at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1$$anonfun$2.apply(DevServerStart.)
at at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.)
at at scala.Option.map(Option.)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.)
at at scala.util.Success.flatMap(Try.)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.)
at at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.)
at at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.)
at at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.)
at at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.)
at at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.)
at at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.)
any thoughts?
Thanks
I'm trying to set AbstractElasticsearchAppender.elasticsearchProperties from logback.groovy but the method AbstractElasticsearchAppender.setProperties(...) is never called.
Appender configuration is:
appender("ELASTIC", ElasticsearchAppender){ it ->
ElasticsearchProperties e = new ElasticsearchProperties()
e.addProperty( new Property("logger", '%logger', false))
properties = e
url = 'http://localhost:9200/_bulk'
index = 'aps-logs-%date{yyyy-MM-dd}'
type = 'log'
rawJsonMessage = false
errorsToStderr = true
includeCallerData = true
def configHeaders = new HttpRequestHeaders()
configHeaders.addHeader(new HttpRequestHeader(name: 'Content-Type', value: 'application/x-ndjson'))
headers = configHeaders
}
I can see logs sent to elasticsearch, but the logger property is not there.
Using logback.xml configuration works fine.
I tried using a property name other that "properties" like this:
AbstractElastucsearchAppender.java
....
public void setProperties(ElasticsearchProperties elasticsearchProperties) {
this.elasticsearchProperties = elasticsearchProperties;
}
public void setProps(ElasticsearchProperties elasticsearchProperties) {
this.elasticsearchProperties = elasticsearchProperties;
}
With that code and using props instead of properties it works :(
I attached a sample with both groovy and xml logback configurations where you can see that setting "properties" from logback.groovy is not working.
@balopat I will really appreciate if you can replicate and confirm this issue since this is a bit weird.
There are plenty of example how to configure the appender, but not how to log data into the appender.
It's pretty obvious how to log text message, but where does the properties take place?
Can you update with library with latest slf4j, ogback-classic and logback-access dependencies.
public void sendData() throws IOException {
if (this.sendBuffer.length() > 0) {
HttpURLConnection urlConnection = (HttpURLConnection)((HttpURLConnection)this.settings.getUrl().openConnection());
try {
...
this.sendBuffer.setLength(0);
if (this.bufferExceeded) {
this.errorReporter.logInfo("Send queue cleared - log messages will no longer be lost");
this.bufferExceeded = false;
}
}
}
Hello!
Would it be possible to do a new release that includes AwsRegionProviderChain fix?
Thank you
Hello,
I was trying to use AWSAuthentication to connect a EC2 instance with Amazon ElasticSearch instance. but I was getting this error while trying to start the app :
com.amazonaws.SdkClientException: Unable to find a region via the region provider chain.
After debugging, the Region was null.
I Fixed the AWSAuthentication in order to get the default region of the server.
Here is the pull request : #69
with this fix, it gets the correct Region.
Added appender to spring boot application.
Attaching config and screenshot of Eclipse MAT report.
Is it possible to connect to the protected ElastciSearch server that is on https and has user name and password?
The reason why I asked this questions is because I got the following error:
2016-02-08 09:10:51.220 ERROR 7 --- [ es-writer-28] es-error-logger : Failed to send events to Elasticsearch: Got response code [401] from server with data <html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
java.io.IOException: Got response code [401] from server with data <html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
at com.internetitem.logback.elasticsearch.writer.ElasticsearchWriter.sendData(ElasticsearchWriter.java:60) ~[logback-elasticsearch-appender-1.2.jar!/:na]
at com.internetitem.logback.elasticsearch.ElasticsearchOutputAggregator.sendData(ElasticsearchOutputAggregator.java:53) ~[logback-elasticsearch-appender-1.2.jar!/:na]
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.run(AbstractElasticsearchPublisher.java:140) [logback-elasticsearch-appender-1.2.jar!/:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
There is what I had in logback.xml
file
<appender name="ELASTIC_PROD_LOGS_APPENDER" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>https://user:[email protected]:25370/_bulk</url>
<index>prod-logs-%date{yyyy-MM-dd}</index>
<type>tester</type>
...
Please allow us to define our own elasticsearch SafeWriter.
I would like to use JEST for writing to ES.
Hi,
Thank you for useful framework,
When I use logger pattern like this:
LOGGER.error("Producing failed, going to try again in {} seconds", this.sleepDelaySeconds, e);
I get {message:Producing failed, going to try again in {} seconds}
I expect to get : {message:Producing failed, going to try again in 5 seconds}
Sincerely,
Pinhas
I'd really like to use rawJsonMessage
so that I can write queries against my log messages.
Hello everyone
I am getting the above error:
Trying to retrieve too many docvalue_fields. Must be less than or equal to: [100] but was [118]. This limit can be set by changing the [index.max_docvalue_fields_search] index level setting.
with this configuration:
<appender name="ELASTIC" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>{URL}</url>
<index>logs-%date{yyyy-MM-dd}</index>
<type>tester</type>
<loggerName>es-logger</loggerName> <!-- optional -->
<errorLoggerName>es-error-logger</errorLoggerName> <!-- optional -->
<connectTimeout>30000</connectTimeout> <!-- optional (in ms, default 30000) -->
<errorsToStderr>false</errorsToStderr> <!-- optional (default false) -->
<includeCallerData>false</includeCallerData> <!-- optional (default false) -->
<logsToStderr>false</logsToStderr> <!-- optional (default false) -->
<maxRetries>3</maxRetries> <!-- optional (default 3) -->
<readTimeout>30000</readTimeout> <!-- optional (in ms, default 30000) -->
<sleepTime>250</sleepTime> <!-- optional (in ms, default 250) -->
<rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
<includeMdc>false</includeMdc> <!-- optional (default false) -->
<maxMessageSize>100</maxMessageSize> <!-- optional (default -1 -->
<authentication class="com.internetitem.logback.elasticsearch.config.BasicAuthentication" /> <!-- optional -->
<properties>
<property>
<name>host</name>
<value>${HOSTNAME}</value>
<allowEmpty>false</allowEmpty>
</property>
<property>
<name>severity</name>
<value>%level</value>
</property>
<property>
<name>thread</name>
<value>%thread</value>
</property>
<property>
<name>stacktrace</name>
<value>%ex</value>
</property>
<property>
<name>logger</name>
<value>%logger</value>
</property>
</properties>
<headers>
<header>
<name>Content-Type</name>
<value>application/json</value>
</header>
</headers>
</appender>
Is there a way to configure the variable max_docvalue_fields_search or should it be done in elastic?
Thanks in advance
In case of the selected ES node being down it would be handy to be able to specify one or more fallback URLs that are tried to publish the messages to.
6.2.4
Failed to send events to Elasticsearch: Got response code [406] from server with data {"error":"Content-Type header [text/plain] is not supported","status":406}
Add ability to use ES 5 ingest pipelines
_pipeline : "pipelineName" to the indexed data. Thais can be done either by making serializeEvents() or serializeIndexString() protected, or by providing additional configuration like:
String pipeline = settings.getPipeline();
if (pipeline != null) {
gen.writeObjectField("_pipeline ", pipeline );
}
We'd love to have 1.7 officially released as it allows us to send int
properties to elastic thanks to #39.
Hi,
Thank you for release,
New Issue :
Elasticsearch prefer add to index date for better indexing, like logstash do : for example: "_index" : "logstash-2013.11.21"
Please do it for default, some thing like this:
Settings class:
public String getIndex() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd");
return index+"-"+simpleDateFormat.format(new Date());
}
I tried this Elastic log appender and this is working fine for access logs but not working for catalina logs, localhost logs and host-manager logs. I am using tomcat juli logging and trying to use "com.internetitem.logback.elasticsearch.ElasticsearchAppender" in place of "org.apache.juli.logging.ch.qos.logback.core.rolling.RollingFileAppender". Is there something I am missing here.
Thanks,
Arun
Hi,
Excuse me if I'm misusing this but I couldn't find any more direct channel of communication. This is more of a question rather than issue:
Under the usage section of the README.md there is a <header>
element under the appender configuration block.
When should we decide to use text/plain
when when should we use something else? Why was it text/plain
instead of application/x-ndjson
like what is described on ElasticSearch's API Official Doc
Thank you in advance!
Best Regards,
Lim
Hi, is there any way to create numeric Properties?
<property>
<name>creationTime</name>
<value>%replace(%msg){'(?:.*creationTime:(\d+)ms)?.*', '$1'}</value>
</property>
Just do:
log.info(null);
and forget about delivering messages to ES until you reboot app ))
The problem is in:
String formattedMessage = event.getFormattedMessage();
if (settings.getMaxMessageSize() > 0 && formattedMessage.length() > settings.getMaxMessageSize()) {
formattedMessage = formattedMessage.substring(0, settings.getMaxMessageSize()) + "..";
}
formattedMessage.length()
generates NPE.
AbstractElasticsearchPublisher
is implemented in so shitty way that internals of JsonGenerator
is stuck in broken state and can't heal.
JsonGenerator
uses WriterBasedJsonGenerator
and on
private void serializeIndexString(JsonGenerator gen, T event) throws IOException {
gen.writeStartObject();
writeStartObject()
fail on internal check _verifyValueWrite("start an object");
as we are JsonWriteContext
is at type == 2 and gotName == false so check fails:
public int writeValue() {
// Most likely, object:
if (_type == TYPE_OBJECT) {
if (!_gotName) {
return STATUS_EXPECT_NAME;
In case of serialization errors JsonGenerator
should be completely reinitialized or reset instead of reusing with broken intermediate state.
Following stacktrace is from a bit edited sources, ClassicElasticsearchPublisher
is in original form:
java.lang.NullPointerException: null
at com.internetitem.logback.elasticsearch.ClassicElasticsearchPublisher.serializeCommonFields(ClassicElasticsearchPublisher.java:37)
at com.internetitem.logback.elasticsearch.ClassicElasticsearchPublisher.serializeCommonFields(ClassicElasticsearchPublisher.java:17)
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.serializeEvent(AbstractElasticsearchPublisher.java:211)
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.serializeEvents(AbstractElasticsearchPublisher.java:190)
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.run(AbstractElasticsearchPublisher.java:154)
at java.base/java.lang.Thread.run(Thread.java:834)
Calling << my ElasticsearchAppender >>.stop() should send any pending data and stop the publisher (thread and all).
@
elastic:abc@[email protected]:9200
Hello,
i want to delete logs using query for deleting logs passed 10 days,
how can i use appender for this ? i can't find how to send body json in the request with appender
the json body contains the query for items to delete :
json = {
"query": {
"range": {
"@timestamp": {
"lte": "now-10d"
}
}
}
}
Thank you
I using elasticsearch-appender in my app with spring_boot-2.2.5.RELEASE
I have the following config in my logback-spring.xml:
<logger name="com.internetitem.logback.elasticsearch.writer.LoggerWriter" level="ERROR" additivity="false">
<appender-ref ref="Console"/>
</logger>
<root level="INFO">
<appender-ref ref="Console"/>
<appender-ref ref="ELASTIC"/>
</root>
But I receive lots of INFO log messages to console from com.internetitem.logback.elasticsearch.writer.LoggerWriter
despite my setting level="ERROR"
of this logger.
All other loggers levels works fine.
The only solution is to set root level to "ERROR".
hi
Can you please add an example of your appender for logbzck.groovy ?
i tried to translate it from logback.xml but it doesn't work for me.
Hi,
I have recently integrated my Spring Boot based service to work with AWS Parameter Store. All passwords that were migrated from application.yaml file (I know, it is bad I had them in this file) were migrated to AWS Parameter store. No other change was required. I am able to retrieve all values using @value annotation of Spring. But, fetch the Elasticsearch password value is not working. It used to work with the password has been located in the application.yaml file.
Do you know how to resolve this issue?
Thanks
After is set up the appender i receive:
Failed to send events to Elasticsearch: Got response code [406] from server with data {"error":"Content-Type header [text/plain] is not supported","status":406}
I didn't found how to set the content type using xml configuration file.
my config is
<appender name="ELASTIC" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>http://myserver/_bulk</url>
<index>log-%date{yyyy-MM-dd}</index>
<type>tester</type>
<loggerName>es-logger</loggerName> <!-- optional -->
<errorLoggerName>es-error-logger</errorLoggerName> <!-- optional -->
<connectTimeout>30000</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>30000</readTimeout> <!-- optional (in ms, default 30000) -->
<sleepTime>250</sleepTime> <!-- optional (in ms, default 250) -->
<rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
<includeMdc>false</includeMdc> <!-- optional (default false) -->
<maxMessageSize>100</maxMessageSize> <!-- optional (default -1 -->
<authentication class="com.internetitem.logback.elasticsearch.config.BasicAuthentication" /> <!-- optional -->
<properties>
<property>
<name>host</name>
<value>${HOSTNAME}</value>
<allowEmpty>false</allowEmpty>
</property>
<property>
<name>severity</name>
<value>%level</value>
</property>
<property>
<name>thread</name>
<value>%thread</value>
</property>
<property>
<name>stacktrace</name>
<value>%ex</value>
</property>
<property>
<name>logger</name>
<value>%logger</value>
</property>
</properties>
<headers>
<header>
<name>Content-Type</name>
<value>text/plain</value>
</header>
</headers>
</appender>
I have properties like correlationId etc which is custom. How do I get that to display in elasticsearch?
Hi Adam,
Is it possible to add the TTL in configuration even if it will change in next releases of ES ?
Best regards,
david
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.