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

Add logging stack trace on auth failure #622

Closed

Conversation

dbeliakov-r7
Copy link

When authentication fails, logger only saves the exception message. This is often not enough to understand what caused the failure.
This change adds the stack trace to the error message.

Copy link
Contributor

@norrisjeremy norrisjeremy left a comment

Choose a reason for hiding this comment

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

No, this is not the way to implement this.
You can simply add the exception as a third argument to the log method call.
I.e getLogger.log(Logger.WARN, ..., ee).

@norrisjeremy
Copy link
Contributor

No, this is not the way to implement this. You can simply add the exception as a third argument to the log method call. I.e getLogger.log(Logger.WARN, ..., ee).

See

getLogger().log(Logger.ERROR, "start_discard finished early due to " + e.getMessage(), e);
for an example how to log the exception stack trace correctly.

@norrisjeremy
Copy link
Contributor

Can you squash this into a single commit?

Copy link

sonarcloud bot commented Aug 16, 2024

norrisjeremy added a commit to norrisjeremy/jsch that referenced this pull request Aug 29, 2024
@norrisjeremy norrisjeremy mentioned this pull request Aug 29, 2024
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