-
Notifications
You must be signed in to change notification settings - Fork 56
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
Logging Refactoring #976
Logging Refactoring #976
Conversation
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.
Just some quick things to check
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.
Thank you @israelboudoux , LGTM!!
@@ -17,19 +17,16 @@ import { setMakeNow } from '../services/block-assembler.mjs'; | |||
const router = express.Router(); | |||
|
|||
router.post('/check', async (req, res, next) => { | |||
logger.debug('block endpoint received POST'); |
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.
Just curious about why did u remove (and not replace) some of the logs in this file (?)
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.
There is a pending PR that will add the capability of logging automatically the Request and Response information for all endpoints when the log level DEBUG is enabled. Actually, I wasn't supposed to remove this now, only after merging the mentioned PR, but it isn't a big deal.
The main goal of this PR is to refactoring the logs to accomplish with the requirement of having our logs compliant to the JSON format.
Logs are recommended to be echoed in JSON because it is simple for reading and is easily ingested by Monitoring tools, which also facilitates the filtering by in Logging tools like CloudWatch, Kibana, Splunk (e.g. 'person.name = 'Bob'').
Below is an example of log output in JSON format.
Regarding other changes in this PR:
/* */
) when the comment spans for more than one line;/** */
) where necessary;