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

log detail errors from remote #58

Merged
merged 3 commits into from
Jul 4, 2024
Merged

log detail errors from remote #58

merged 3 commits into from
Jul 4, 2024

Conversation

jagedn
Copy link
Collaborator

@jagedn jagedn commented Jul 3, 2024

in some situations we need more details about the error returned by the server so log them

Signed-off-by: Jorge Aguilera <[email protected]>
@jagedn jagedn marked this pull request as draft July 3, 2024 18:41
Signed-off-by: Jorge Aguilera <[email protected]>
@jagedn jagedn marked this pull request as ready for review July 3, 2024 18:57
Copy link
Member

@abhi18av abhi18av left a comment

Choose a reason for hiding this comment

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

Looks good to merge - Thanks @jagedn!

I have added a question regarding the overall best-practice for log.debug and log.error .

try {
jobsApi.deleteJob(jobId, config.jobOpts().region, config.jobOpts().namespace, null, null, purge, true)
}catch(Exception e){
log.error("[NOMAD] Failed to delete job ${jobId} -- Cause: ${e.message ?: e}", e)
Copy link
Member

Choose a reason for hiding this comment

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

@jagedn , do you think that within an exception block, we should use only log.debug or this should be decided as per the context?

I think error makes sense for session terminating steps and not for the retries - what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good question

yes, you're right, probably we can use only debug level in retries and if the user want to have more details can change the level

Copy link
Member

Choose a reason for hiding this comment

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

Thanks Jorge, I've refactored accordingly 👍

@abhi18av abhi18av merged commit 0a274d6 into master Jul 4, 2024
@abhi18av abhi18av deleted the add-logs branch July 4, 2024 17:57
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