Closed pascalgrimaud closed 2 years ago
I can work in this
Thanks @MSaguer If possible, small PR in each contexts would be cool :-)
@pascalgrimaud, I'm struggling with the traces generated by LogstashTcpLifeCycleTest unit test.
22:24:02,504 |-WARN in net.logstash.logback.appender.LogstashTcpSocketAppender[ASYNC_LOGSTASH_TCP] - Log destination localhost/127.0.0.1:5000: connection failed. java.net.ConnectException: Connection refused: no further information
at java.net.ConnectException: Connection refused: no further information
at at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
Net.java:672
at at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
NioSocketImpl.java:542
at at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
NioSocketImpl.java:597
at at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
SocksSocketImpl.java:327
at at java.base/java.net.Socket.connect(Socket.java:633)
Socket.java:633
at at net.logstash.logback.appender.AbstractLogstashTcpSocketAppender$TcpSendingEventHandler.openSocket(AbstractLogstashTcpSocketAppender.java:762)
AbstractLogstashTcpSocketAppender.java:762
at at net.logstash.logback.appender.AbstractLogstashTcpSocketAppender$TcpSendingEventHandler.onStart(AbstractLogstashTcpSocketAppender.java:681)
AbstractLogstashTcpSocketAppender.java:681
at at net.logstash.logback.appender.AsyncDisruptorAppender$EventClearingEventHandler.onStart(AsyncDisruptorAppender.java:382)
AsyncDisruptorAppender.java:382
at at net.logstash.logback.encoder.com.lmax.disruptor.BatchEventProcessor.notifyStart(BatchEventProcessor.java:224)
BatchEventProcessor.java:224
at at net.logstash.logback.encoder.com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:120)
BatchEventProcessor.java:120
at at java.base/java.lang.Thread.run(Thread.java:833)
Thread.java:833
I first though that it could be solved by setting logback configuration on 'net.logstash.logback' but it has no effect. Any idea?
I'll have a look
I tried and I didn't find the good configuration to ignore these logs.
I think it's because of LogstashTcpLifeCycle
which uses internal logger to send logs to Logstash.
So we can simply ignore these logs for now:
Another solution would be to try to completely rework the LogstashTcpLifeCycleTest
test, to transform to IntegrationTest, with Spring Context, but it's not deserved to spend too much time to reduce few lines of logs
Following your other comment @MSaguer, I think there are some work before closing this ticket:
Unit tests seems OK for me but Integration Tests are not. It requires new needle in application-test.properties to be able to configure logging. It's in progress.
Here is its new content
spring.main.banner-mode=off
# Logging configuration
logging.level.{{packageName}}=OFF
# jhipster-needle-application-test-logging-properties
# jhipster-needle-application-test-properties
I think we already have a good approach and lot of work has been done so this ticket can be closed
Plz claim the bounty @MSaguer
Hi @pascalgrimaud, here is the bounty claim https://opencollective.com/generator-jhipster/expenses/89915 With some delay :)
@MSaguer approved
When launching tests in a generated projects, there are still a lot of useless logs It means we should add more logger name to ignore in
logback.xml