Skip to content

Conversation

@heneryville
Copy link

Although rare (about 1 in 25 times) stderr does not alway emit it's output on line boundaries. Because the pattern depends on line boundaries, this causes some events to not be emitted.

This is especially the case for joined and left events, where the log entries the patterns are looking for are followed especially closely by other entries.

This commit explicitly breaks logs into lines before parsing them thus causing the events to be detected correctly.

@heneryville
Copy link
Author

I just modified this pull request a bit. I was getting similar line boundary errors with java exceptions. If a data chunk started with a normal log line, but then included more, such as a java exception stack trace, then parseLog would explode.

Now, instead of converting emitLog to do line deliniation, the entire stream is split by line. I embedded (to reduce dependencies) the byline.js package to do this.

Also, the whole debouncing of java lines was completely broken, so I removed that. Now java events are emitted separately by line.

@dominicbarnes
Copy link
Owner

I'll take a look at this soon, I've found this mechanism lacking and am glad to have another set of eyes on it.

One thing I can think of off the bat, I'd rather have the dependency installed via npm than embedded, would you mind changing that?

@heneryville
Copy link
Author

Ok. I'll change it to be an npm dependency. It may be a few days before I get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants