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

fix: Mention exception in log message on failures #497

Merged

Conversation

runeflobakk
Copy link
Contributor

Brief, plain english overview of your changes here

A small suggestion for some improved ergonomics when reading log output from db-scheduler in the case of failures.

I always find it effective to include a small "summary" of any caught exception in the actual log message. Often this will allow me to pinpoint the error at hand without needing to look into the stacktrace of the logger event. (But this is still possible of course, as before)

Logs when exceptions propagates all the way back to db-scheduler can typically look like this:
db-scheduler-failure-log

This PR will change the log message to mention the actual exception which was caught in the log message:

Unhandled exception IllegalArgumentException: 'Illegal character in path at index 9: [replace with URL]' during execution of task with name 'my-task-name'. Treating as failure.

Fixes

No existing issue, I suspect. Please consider this PR the issue, with a suggested fix, all bundled nicely together :)

Reminders

  • Added/ran automated tests (existing tests have been run)
  • Update README and/or examples (no update necessary, I think)
  • Ran mvn spotless:apply

cc @kagkarlsson

@runeflobakk runeflobakk force-pushed the include-exception-in-log-message branch from ab84d11 to d40b0bf Compare May 30, 2024 15:53
@runeflobakk runeflobakk force-pushed the include-exception-in-log-message branch from d40b0bf to 3639bcf Compare May 30, 2024 15:58
Copy link
Owner

@kagkarlsson kagkarlsson left a comment

Choose a reason for hiding this comment

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

Lets ship it! 🏅

@kagkarlsson kagkarlsson changed the title Mention exception in log message on failures fix: Mention exception in log message on failures May 30, 2024
@kagkarlsson kagkarlsson merged commit 04692f7 into kagkarlsson:master May 30, 2024
5 of 6 checks passed
@runeflobakk runeflobakk deleted the include-exception-in-log-message branch May 30, 2024 19:47
@kagkarlsson kagkarlsson added the released Issue has been released label Jun 5, 2024
@kagkarlsson
Copy link
Owner

🎉 This issue has been resolved in v14.0.1 (Release Notes)

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

Successfully merging this pull request may close these issues.

2 participants