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

Update 'fatal' log message to be a single call #154

Merged

Conversation

arp-0984
Copy link
Collaborator

No description provided.

@arp-0984 arp-0984 requested review from jpdahlke and jdcove2 May 26, 2021 16:37
logger.error("##### # # # # # # ");
logger.error("# ####### # ####### # ");
logger.error("# # # # # # # ");
logger.error("# # # # # # #######");
logger.error("Fatal Thread Error on " + thread.getName() + " had an uncaught exception", throwable);
Copy link
Collaborator

@drivenflywheel drivenflywheel May 26, 2021

Choose a reason for hiding this comment

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

If we want this message to have greater cosmetic visibility, this could still use a multi-line message ("i.e., "####################\nFatal Thread Error on ..."), but otherwise this looks good.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That would certainly avoid the multiple logger calls which is the main issue, but the secondary objectives are to make it human readable and make it consumable downstream w/ log analysis tools. Changing the level to FATAL could achieve this as well, but I'm ok with the simplicity here and leaving it ERROR.

This should be convertible to parameterized logging. That would be my only ask. Bonus points for fixing both log statements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added parameterized logging for both log statements in the most recent change

logger.error("##### # # # # # # ");
logger.error("# ####### # ####### # ");
logger.error("# # # # # # # ");
logger.error("# # # # # # #######");
logger.error("Fatal Thread Error on " + thread.getName() + " had an uncaught exception", throwable);
Copy link
Collaborator

Choose a reason for hiding this comment

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

That would certainly avoid the multiple logger calls which is the main issue, but the secondary objectives are to make it human readable and make it consumable downstream w/ log analysis tools. Changing the level to FATAL could achieve this as well, but I'm ok with the simplicity here and leaving it ERROR.

This should be convertible to parameterized logging. That would be my only ask. Bonus points for fixing both log statements.

logger.error("# # # # # # # ");
logger.error("# # # # # # #######");
logger.error("Fatal Thread Error on " + thread.getName() + " had an uncaught exception", throwable);
logger.error("Fatal Thread Error on {} had an uncaught exception {}", thread.getName(), throwable);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The second set of {}'s can be dropped. The exception will be handled naturally w/o replacement as long as it's the last parameter provided.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed the second set of {}'s

@jpdahlke jpdahlke added this to the v6.7.0 milestone Jun 17, 2021
@jpdahlke jpdahlke merged commit fa91c26 into NationalSecurityAgency:master Sep 29, 2021
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.

4 participants