[IMPROVE] Change log format to JSON#22975
Merged
sampaiodiego merged 35 commits intodevelopfrom Sep 8, 2021
Merged
Conversation
KevLehman
reviewed
Aug 20, 2021
Member
Author
|
I've changed my mind and I'll switching to pino instead https://getpino.io/ |
Member
Author
|
The PR is at pretty good shape and ready to be reviewed.. the missing items are not requirements to get this merged. |
Contributor
|
@sampaiodiego do you have an example of this output? |
Member
Author
oh, sorry, I should have added some.. let me get them and I'll update PR's description 😉 |
Member
Author
|
here are some examples: some info regarding levels:
so to be able to see the logs below I have enabled Info log level on admin |
ggazzo
approved these changes
Sep 8, 2021
gabriellsh
added a commit
that referenced
this pull request
Sep 9, 2021
…Rocket.Chat into feat/seats-cap-request-seats * 'feat/seats-cap-request-seats' of github.com:RocketChat/Rocket.Chat: (59 commits) Chore: client endpoints typings (#23152) Chore: Update pino and pino-pretty (#23157) Bump @rocket.chat/string-helpers in /ee/server/services (#23138) [FIX] Inaccurate use of 'Mobile notifications' instead of 'Push notifications' in i18n strings (#22978) Bump xml-crypto from 2.1.2 to 2.1.3 (#23141) [IMPROVE] Change log format to JSON (#22975) Regression: Auth banner for EE (#23091) [IMPROVE][APPS] Return task ids when using the scheduler api (#23023) [FIX] Update bugsnag package (#23104) Bump pm2 from 5.1.0 to 5.1.1 in /ee/server/services (#23128) Bump @types/ejson from 2.1.2 to 2.1.3 in /ee/server/services (#23126) Chore: Remove non-used dependencies (#23109) Bump @types/ws from 7.4.6 to 7.4.7 in /ee/server/services (#23095) Bump tar from 6.1.0 to 6.1.11 in /ee/server/services (#23068) Bump @types/imap from 0.8.34 to 0.8.35 (#23122) Bump csv-parse from 4.16.0 to 4.16.3 (#23120) Language update from LingoHub 🤖 (#23123) Bump juice from 5.2.0 to 8.0.0 (#22177) [FIX] Change way emails are validated on livechat registerGuest method (#23089) [IMPROVE] Use PaginatedSelectFiltered in department edition (#23054) ...
gabriellsh
added a commit
that referenced
this pull request
Sep 14, 2021
…to feat/seats-cap-info-card * 'feat/seats-cap' of github.com:RocketChat/Rocket.Chat: (59 commits) Chore: client endpoints typings (#23152) Chore: Update pino and pino-pretty (#23157) Bump @rocket.chat/string-helpers in /ee/server/services (#23138) [FIX] Inaccurate use of 'Mobile notifications' instead of 'Push notifications' in i18n strings (#22978) Bump xml-crypto from 2.1.2 to 2.1.3 (#23141) [IMPROVE] Change log format to JSON (#22975) Regression: Auth banner for EE (#23091) [IMPROVE][APPS] Return task ids when using the scheduler api (#23023) [FIX] Update bugsnag package (#23104) Bump pm2 from 5.1.0 to 5.1.1 in /ee/server/services (#23128) Bump @types/ejson from 2.1.2 to 2.1.3 in /ee/server/services (#23126) Chore: Remove non-used dependencies (#23109) Bump @types/ws from 7.4.6 to 7.4.7 in /ee/server/services (#23095) Bump tar from 6.1.0 to 6.1.11 in /ee/server/services (#23068) Bump @types/imap from 0.8.34 to 0.8.35 (#23122) Bump csv-parse from 4.16.0 to 4.16.3 (#23120) Language update from LingoHub 🤖 (#23123) Bump juice from 5.2.0 to 8.0.0 (#22177) [FIX] Change way emails are validated on livechat registerGuest method (#23089) [IMPROVE] Use PaginatedSelectFiltered in department edition (#23054) ...
gabriellsh
added a commit
that referenced
this pull request
Sep 14, 2021
…to max-seats-backend * 'feat/seats-cap' of github.com:RocketChat/Rocket.Chat: (61 commits) [NEW] Seats Card (#23077) Chore: client endpoints typings (#23152) Chore: Update pino and pino-pretty (#23157) Bump @rocket.chat/string-helpers in /ee/server/services (#23138) [FIX] Inaccurate use of 'Mobile notifications' instead of 'Push notifications' in i18n strings (#22978) Bump xml-crypto from 2.1.2 to 2.1.3 (#23141) [IMPROVE] Change log format to JSON (#22975) Regression: Auth banner for EE (#23091) [IMPROVE][APPS] Return task ids when using the scheduler api (#23023) [FIX] Update bugsnag package (#23104) Bump pm2 from 5.1.0 to 5.1.1 in /ee/server/services (#23128) Bump @types/ejson from 2.1.2 to 2.1.3 in /ee/server/services (#23126) Chore: Remove non-used dependencies (#23109) Bump @types/ws from 7.4.6 to 7.4.7 in /ee/server/services (#23095) Bump tar from 6.1.0 to 6.1.11 in /ee/server/services (#23068) Bump @types/imap from 0.8.34 to 0.8.35 (#23122) Bump csv-parse from 4.16.0 to 4.16.3 (#23120) Language update from LingoHub 🤖 (#23123) Bump juice from 5.2.0 to 8.0.0 (#22177) [FIX] Change way emails are validated on livechat registerGuest method (#23089) ...
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes (including videos or screenshots)
The idea is to have a new and standardized log format so looked like a good opportunity to also switch to a well known library.
Logger, either viamethods,sections, etc . If you want similar functionality you can create a child logger usingLogger.section(probably need a better name for this, other thansection)infoand add useful info to identify who is calling the endpointsLogger(there are specific functions for it now)console.logand switched toLoggerSystemLoggerto use the newLoggerclassLoggerManagerand its related settingsA few items that needs some attention:
console.logare now suppressed as the default log level is still ERROR and those logs were changed to INFOHere is how the new logs format looks like:
To be able to see the logs below I have enabled INFO log level on admin.
Some info regarding levels, I have created a custom one called HTTP so it is shown along with INFO logs:
INFOHTTPERRORIssue(s)
Steps to test or reproduce
Further comments