Closed joepb closed 2 years ago
Thanks this looks great, I was hoping someone would add TCP support. Should be able to give this a quick review and merge early next week.
I added some logic to the MR to make the logger thread-safe. I found a few occurrences in production scenarios where two simultaneous threads writing resulted in messages being malformed.
A TCP Socket will be opened per thread writing to prevent the locking of threads (which could be a severe performance hit). If the logging mechanism is smart enough to consolidate onto one thread (which it seems to be in most cases), there should be no overhead of this thread localization.
Added in #69.
On less than optimal networks, UDP isn't the best protocol, as it's a fire-and-forget setup. Http(s) is very poorly supported by Graylog and is very slow in processing input.
TCP on the other hand has proven to be stable and more reliable. It comes with some small performance considerations, but in some operations, reliability would outweigh the performance.