-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot 2.2.2.RELEASE with logstash-logback-encoder Versions > 5.2 service fails with System.Exit 0 #387
Comments
Can you provide an example application (maybe a small one from from start.spring.io) that reproduces this problem? What OS? What Java distribution and version? |
I can confirm this problem with the given parameters. Exact the same behaviour. That's why we downgraded to 5.2 again. |
Hi @PatrickHuetter and @englishbobster I have not been able to reproduce this problem with this simple project when running on Ubuntu 18.04 with OracleJDK 1.8.0_181 or AdoptOpenJDK 11.0.5. I've tried running the app directly ( Can one of you provide an example application (maybe a small one from from start.spring.io) that reproduces this problem? What OS are you using? What Java distribution and version are you using? I'm willing to get this fixed, but I need your help to reproduce the problem. |
Hi,
sorry I have been neglecting this.
Of course, found this behavior at work and have not had time to get back.
Hope to add more over the weekend.
/Stu
…On Fri, Jan 24, 2020 at 5:05 AM Phil Clay ***@***.***> wrote:
Hi @PatrickHuetter <https://github.com/PatrickHuetter> and @englishbobster
<https://github.com/englishbobster>
I have not been able to reproduce this problem with this simple project
<https://github.com/logstash/logstash-logback-encoder/files/4106758/demo.zip>
when running on Ubuntu 18.04 with OracleJDK 1.8.0_181 or AdoptOpenJDK
11.0.5. I've tried running the app directly (java --jar
target/demo-0.0.1-SNAPSHOT.jar), with the spring-boot-maven-plugin (mvn
spring-boot:run), and directly from IntelliJ.
Can one of you provide an example application (maybe a small one from from
start.spring.io) that reproduces this problem?
What OS are you using?
What Java distribution and version are you using?
I'm willing to get this fixed, but I need your help to reproduce the
problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#387>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCUH3RVIGXKJDJKC2OWPBTQ7JSINANCNFSM4KEYQ45Q>
.
|
I faced the same issue, but the problem is a little bit weird. I have 2 projects, both using Spring Boot. In the first project, I have Spring Boot version 2.2.4 with Java version 8, everything's running fine with version 6.3. I then copy the appender configuration to the second project (which is an existing project that using Spring Boot version 2.2.2 and Java version 8) but this time it doesn't work as expected, my project fails to start with exit code 1. Both version 6.3 and 5.3 is not working. Turn on debug, this is what I've got:
Below is my logback configuration:
I've tried to increase the Spring Boot version to 2.2.4 on the second project but no luck. If i downgrade the version of library to 5.2, it works normally. |
Since this is such a strange issue, I'm not going to be able to debug/fix/test this unless someone can provide a complete project (uploaded as a zip) that can reproduce this issue. I have not been able to reproduce it with the provided logback configuration files and spring boot versions. Since the same logback configuration files are working in some projects, and not others, I don't believe this is limited to just a problem between logstash-logback-encoder and spring-boot. I think something else is at play as well. And without a project that can reproduce this problem, I cannot determine what that something else is. |
I've created a repository for the failed project. It contains no logic source code, but I try to keep the pom.xml file nearly the same as my aforementioned failed project. This project crashed when using version 6.3. If downgrade to 5.2 version, it's working fine. https://github.com/duclm2609/debug-logstash-logback-springboot My laptop is running MacOS Catalina 10.15.2. Hope this will help. |
Thanks @duclm2609 ! While debugging your example application with logstash-logback-encoder >= v5.3, I found the following exception occurring during startup:
Starting with logstash-logback-encoder v5.3, automatic discovery of jackson modules was enabled by default. With logstash-logback-encoder <= 5.2, the problem does not occur because automatic discovery of jackson modules does not occur by default. The root cause is a bug in liquibase reported as CORE-3542. Basically the liquibase-core jar contains a service definition file ( There are three possible solutions to get this to work with the latest logstash-logback-encoder: A) Don't use OR B) Disable automatic jackson module discovery (as mentioned here) for the encoder/layout. For example: <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<findAndRegisterJacksonModules>false</findAndRegisterJacksonModules>
... OR C) Add the dependency that contains the <dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
</dependency> @duclm2609, Any one of these solutions will allow your example project to work with the latest logstash-logback-encoder. @englishbobster and @PatrickHuetter , can you see if these solutions address your problems as well? I'm going to assume that it is the same problem. I'll close this issue if I don't hear back after a while. |
Thanks @philsttr . I've applied solution B and it worked. |
Bit late to the party....but solution B worked fine. Thanks for the help and sorry didn't have time to expand/help out on the issue. |
Solution C worked with Spring Boot 2.1.7.RELEASE, Logstash 6.3 and a personalized |
@philsttr thanks for the analysis and an explanation |
Hi,
we have tried to use Spring Boot 2.2.2.RELEASE with logstash-logback-encoder:
together with JSON formatted structured logging.
application.properties is working otherwise with non-json logging.
logback-spring.xml looks something like this:
In all cases where the logstash-logback-encoder version is greater than 5.2 we see that our Spring Boot services fails to start and exits with status 0.
Anyone else experiencing similar problems?
The text was updated successfully, but these errors were encountered: