Skip to content
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

Provide current log line context when a parsing exception is encountered #767

Open
stennie opened this issue Dec 31, 2019 · 2 comments
Open

Comments

@stennie
Copy link
Collaborator

stennie commented Dec 31, 2019

Unexpected log parsing exceptions currently die with a stack trace. It would be helpful to catch the exception and report the offending log line and any other available context.

@stennie stennie self-assigned this Dec 31, 2019
@stennie stennie added this to the 1.6.1 milestone Dec 31, 2019
@stennie stennie modified the milestones: 1.6.1, 1.6.2 Jan 2, 2020
@stennie stennie modified the milestones: 1.6.2, 1.6.3 Feb 4, 2020
@stennie stennie removed their assignment Jan 18, 2021
@virajut
Copy link
Contributor

virajut commented Jan 19, 2021

Hi @stennie,

Can you share more details about this issue?

@stennie
Copy link
Collaborator Author

stennie commented Jan 19, 2021

@virajut See #764 for discussion that led to the creation of this suggestion.

Unexpected exceptions can currently result in a stack trace which would benefit from additional context (like the current log line being parsed) to help understand and resolve issues faster. The specific example was problematic JSON that has now been fixed, but I've encountered this with other logs (usually accompanying bug reports on GitHub 😄 ). Without knowing the offending log line, there's a bit of guesswork involved based on the stack trace and filtering of the original log file.

Exceptions probably need to be caught via the log iteration in util/logfile.py which is used by all of the log tools.

I don't have any examples handy that will trigger an exception at the moment (you'd have to find or construct some for tests). I was expecting there might be new bug reports that would motivate creating & testing this change, but there haven't been any so far.

Regards,
Stennie

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

No branches or pull requests

2 participants