-
Notifications
You must be signed in to change notification settings - Fork 122
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
Update 'fatal' log message to be a single call #154
Conversation
logger.error("##### # # # # # # "); | ||
logger.error("# ####### # ####### # "); | ||
logger.error("# # # # # # # "); | ||
logger.error("# # # # # # #######"); | ||
logger.error("Fatal Thread Error on " + thread.getName() + " had an uncaught exception", throwable); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
a651cc3
to
6f17e43
Compare
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
6f17e43
to
78d9097
Compare
No description provided.