Giter VIP home page Giter VIP logo

Comments (13)

osiegmar avatar osiegmar commented on May 25, 2024

From my understanding this can only happen if the DatagramChannel has been closed by the method de.siegmar.logbackgelf.GelfUdpAppender#close as the channel itself is not connected to a remote system. This close method is called by logback when it is stopping (commonly because of shutting down the whole application). Could that be the case in your scenario?

Is the exception thrown all the times after this first minute or does it stop at some point?

Furthermore, the whole stack trace would be interesting. It might contain additional information...

from logback-gelf.

pfeiler avatar pfeiler commented on May 25, 2024

Thanks for having a look into this.

  • Exception is thrown with every log statement after channel has closed.
  • The channel closes always at the same log statement, why I don't know.
  • The next entries in the stacktrace are from classes from our application (can't disclose).

I googled a bit, would you please have a look at:
t0xa/gelfj#87 (comment) and t0xa/gelfj@15842b8

from logback-gelf.

osiegmar avatar osiegmar commented on May 25, 2024

Ok, I need some more time to investigate. I tried to reproduce this by shutting down the graylog server and starting it again, but as expected it did not result in any exception. What operating system and Java version do you use with logback-gelf?

from logback-gelf.

osiegmar avatar osiegmar commented on May 25, 2024

Cannot reproduce here. Can you try the branch https://github.com/osiegmar/logback-gelf/tree/udp-reopen (version 1.1.1-SNAPSHOT)? I'm testing for isOpen() here and reopen the channel if required.

from logback-gelf.

etluchs avatar etluchs commented on May 25, 2024

similar problem here. Only it appears after quite long time (weeks) and only sporadic. Will try the "robust" version ...

from logback-gelf.

osiegmar avatar osiegmar commented on May 25, 2024

Did the udp-reopen branch solved the issue for someone?

from logback-gelf.

pfeiler avatar pfeiler commented on May 25, 2024

from logback-gelf.

etluchs avatar etluchs commented on May 25, 2024

Similar here :-( sorry. For the installation in question, we switched to logging to stdout and let docker the forwarding to graylog.
We may still use it for one of the non-docker environments though ...

from logback-gelf.

osiegmar avatar osiegmar commented on May 25, 2024

Please reopen this ticket if someone can test the branch

from logback-gelf.

Rustam-Kadyrov avatar Rustam-Kadyrov commented on May 25, 2024

Had similar problem with version 1.x under docker container. After certain activities GELF appender stopped sending messages to Graylog with exception: java.nio.channels.ClosedChannelException.
Unfortunately I have no chance to check your branch on prod.

from logback-gelf.

hlzhang avatar hlzhang commented on May 25, 2024

Had similar problem with version 1.x under docker container. After certain activities GELF appender stopped sending messages to Graylog with exception: java.nio.channels.ClosedChannelException.
Unfortunately I have no chance to check your branch on prod.

+1

from logback-gelf.

skreuzhuber avatar skreuzhuber commented on May 25, 2024

We had the very same issue and have tested your branch successfully.

We had lost GELF messages after an uptime of about 1-2 days, e.g. no more GELF messages were sent by our applications. In our log files we have encountered the stated ClosedChannelException. We use the GELF Appender within various Spring Boot applications that are deployed as Docker containers and send logs via GELF to Graylog.

This issue was solved by building and including your fix (https://github.com/osiegmar/logback-gelf/tree/udp-reopen). Since about 2 weeks no GELF messages were lost on various environments.

Thanks a lot for your effort. We would kindly appreciate if you merge the fix into the master and include it within one of your next releases. Thanks!

from logback-gelf.

osiegmar avatar osiegmar commented on May 25, 2024

@skreuzhuber Thanks for your test and for confirming, that the udp-reopen branch fixes the problem!

from logback-gelf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.