Skip to content

Refactor: improve debug logging (log catched exceptions) #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 1, 2020

Conversation

kares
Copy link
Contributor

@kares kares commented Nov 11, 2020

tried to normalize traces involving :filename or :path to be more consistent - easier to grep.
otherwise the intent is mostly (debug) logging exceptions the plugin's expected to rescue and continue running.

particularly, I wasn't sure why a watched file keeps going through the read loop (having new content)
but comes out as never reading anything on Windows (e.g. from here), knowing whether there's an EOF or file-access gone wrong would confirm whether there's a deeper issue in the plugin or not.

have also raised a few traces to the debug level - ones that seem to provide more value than just tracing what the plugin is processing atm.

@kares kares changed the title Refactor: some more trace logs Refactor: some more debug/trace logging Nov 11, 2020
@kares kares marked this pull request as ready for review November 16, 2020 10:16
@kares kares changed the title Refactor: some more debug/trace logging Refactor: better debug logging + minor refactorings Nov 16, 2020
@andsel andsel self-requested a review November 16, 2020 13:59
@andsel andsel assigned andsel and unassigned elasticsearch-bot Nov 16, 2020
Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, but there are some tracelog not guarded by logger.trace? &&. If we apply the rule to lazy evaluate the log expressions, probably it should be applied everywhere a tracelog is used, WDYT?

@kares
Copy link
Contributor Author

kares commented Dec 1, 2020

added logger.trace? && ... guards + a few on debug as well (hot paths) but generally that wasn't much of the intent here.

@kares kares requested a review from andsel December 1, 2020 07:49
Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kares LGTM

@kares kares changed the title Refactor: better debug logging + minor refactorings Refactor: improve debug logging (log catched exceptions) Dec 1, 2020
@kares kares merged commit 871e40e into logstash-plugins:master Dec 1, 2020
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.

3 participants