log
log copied to clipboard
Add Logentries handler.
This handler will report to LogEntries with a TCP token.
@tj @phacops - ping
Hey, this would be useful to me. Is there any chance of this being upstreamed soon?
cc: @tj
hmm weird I thought I commented on this one, added
LGTM other than the potentially superfluous Close
@tj @johnwchadwick - Just rebased - a review would be great. I imagine in long running situations the HandleLog
function could return an error if the socket gets closed or borked. May have to call NewLogHandler
in that case.
@johnwchadwick care to check it out? I don't use logentries
Oh, I think the current code is probably sufficient. The le_go library does ensure the TCP socket is open and will attempt to reconnect if not, and if that fails it will return an error.
That being said, I definitely think the Close
is superfluous. In fact, if it weren't for the fact that le_go ensures the socket is open, that defer Close would probably cause a problem since it runs before the handler is even returned from the constructor.
yep, cool. I'll tweak a few things and get that in tomorrow. We're missing comments and the style is a bit different than the others (they all use New()
for ex). OCD but hey haha, I like keeping things consistent.
Please add comments to your content!
Hmm. I'm running some tests with this in a close-to-production environment and I actually see some issues with the reliability. It seemed to arbitrarily disconnect silently and not reconnect. It's kind of strange given that bsphere/le_go
seems to have it's own reconnection logic.
Well, YMMV. I may try to roll a version that doesn't have external dependencies for my own usage, since the LE protocol is pretty braindead-simple anyways.
And, now I've done that. My LogEntries handler is available here. Of course, there's no guarantee that my implementation of the LogEntries protocol is better than bsphere/le_go
. I did it because I am experiencing issues in my environment and because I wanted more control. That being said, if there's ever any interest in upstreaming this version, let me know.