Skip to content

Improve logging messages for better debugging in email sending failures#1534

Open
Vaibhav34-2006 wants to merge 11 commits intojenkinsci:mainfrom
Vaibhav34-2006:improve-email-logging
Open

Improve logging messages for better debugging in email sending failures#1534
Vaibhav34-2006 wants to merge 11 commits intojenkinsci:mainfrom
Vaibhav34-2006:improve-email-logging

Conversation

@Vaibhav34-2006
Copy link
Copy Markdown
Contributor

This PR improves logging messages in email sending failure scenarios to provide more clarity for debugging.

Changes:

  • Enhanced messages for SMTP communication errors
  • Improved description for invalid recipient failures
  • Added more context for unexpected exceptions

These changes do not modify any logic and are intended to improve observability and troubleshooting.

Testing:

  • Build successful with mvn clean install -DskipTests
  • Formatting fixed using mvn spotless:apply

Thank you!

@Vaibhav34-2006 Vaibhav34-2006 requested a review from a team as a code owner March 26, 2026 18:27
@ArpanC6
Copy link
Copy Markdown

ArpanC6 commented Mar 27, 2026

Hlw @Vaibhav34-2006 I noticed that there’s an extra quote at the end of two log messages,

"Email sending failed due to invalid or rejected recipient addresses. Verify email formats and permissions.""
"Unexpected error while sending email. Possible causes: invalid SMTP config, network issues, or message formatting errors.""

These trailing quotes would end up in the actual log output, and it might make things a bit confusing while debugging. Can you please remove them?

@ArpanC6
Copy link
Copy Markdown

ArpanC6 commented Mar 27, 2026

Just a quick note this PR has 10 commits for what seems like a fairly small change. It might be a good idea to squash them into 1 or 2 more meaningful commits before merging, just to keep the git history nice and clean. You can easily do that with git rebase -i.

@ArpanC6
Copy link
Copy Markdown

ArpanC6 commented Mar 27, 2026

I noticed the PR description mentions testing was done with mvn clean install -DskipTests, which skips the test suite. Could you also run mvn test and confirm that all tests pass? It’d be great to make sure nothing unexpected was affected.

@Vaibhav34-2006
Copy link
Copy Markdown
Contributor Author

Hi, I also noticed an incorrect log message in the startBuild method while working on logging improvements, so I included this small fix in the same PR.

Please let me know if you'd prefer this to be in a separate PR.

@ArpanC6
Copy link
Copy Markdown

ArpanC6 commented Mar 27, 2026

Hey @Vaibhav34-2006, thanks for the quick fix Including it in the same PR makes sense since it’s related to the same logging improvements. Everything looks good to me..

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