Comments (13)
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.
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.
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.
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.
similar problem here. Only it appears after quite long time (weeks) and only sporadic. Will try the "robust" version ...
from logback-gelf.
Did the udp-reopen branch solved the issue for someone?
from logback-gelf.
from logback-gelf.
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.
Please reopen this ticket if someone can test the branch
from logback-gelf.
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.
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.
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.
@skreuzhuber Thanks for your test and for confirming, that the udp-reopen branch fixes the problem!
from logback-gelf.
Related Issues (20)
- All newlines in short messages are replaced with whitespaces HOT 10
- GelfHttpAppender does not set Uri HOT 1
- Improve test coverage
- Add the possibility to filter included MDC keys HOT 3
- Add a configurable socket timeout HOT 5
- Macbook GelfUdpAppender garbled HOT 2
- GZIP Compression with GelfUdpAppender HOT 1
- Update logback-classic to 1.2.8 HOT 3
- Logback-classic release 1.2.9
- tcp configuration error HOT 3
- Add ability to log thread ID in addition to thread name HOT 2
- Enable adding multiple static fields via environment variable and/or logback.properties HOT 2
- Mutual TLS fails, HOT 1
- Add another method for adding static field to GelfEncoder HOT 2
- GelfMessage should fail on host = "", shortmessage="" HOT 4
- Add ability to log formatted time HOT 1
- Add use of structured arguments HOT 1
- JSON Encoding Performance HOT 1
- Several minor improvements HOT 1
- Faster MessageIdSupplier with less object allocation, error-prone HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logback-gelf.