-
Notifications
You must be signed in to change notification settings - Fork 325
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
Json logging #836
Json logging #836
Conversation
Self-review: Use of this type is discouraged. Note the following equivalence:
In addition to being equivalent in the structural sense, the two |
libs/imports/src/Orphans.hs
Outdated
@@ -6,10 +6,3 @@ | |||
-- | Orphan instances for non-Wire-specific types and classes. | |||
module Orphans () where |
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.
please decomission the orphanage. it's abandoned.
The old netstrings option is now deprecated, use logFormat instead. logFormat takes presedence of netstrings if both are set. If none are set, log format defaults to Plain
The implementation is very trivial at the moment. Namely "undefined" as I think we should spend some time bikeshedding what the log format will look like in JSON. Once we have done that I can implement it in a few minutes
@fisx Example logs: [galley] {"request":"N/A","targets":"336a018e-c8f1-49c4-b395-f781c94a255f","msgs":["D","Teams.addTeamMemberInternal"]}
[galley] {"code":"403","label":"legalhold-not-enabled","request":"N/A","msgs":["D","\"legal hold is not enabled for this team\""]
[galley] {"code":"400","label":"legalhold-invalid-key","request":"N/A","msgs":["D","\"legal hold service pubkey is invalid\""]}
[galley] {"request":"N/A","targets":"2a18c226-eb2f-4037-8d74-dac55a04417c","msgs":["D","LegalHold.approveDevice"]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings"]}
[galley] {"code":"403","label":"no-team-member","request":"N/A","msgs":["D","\"Requesting user is not a team member.\""]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings"]}
[galley] {"code":"403","label":"operation-denied","request":"N/A","msgs":["D","\"Insufficient permissions (missing ChangeLegalHoldTeamSettings)\""]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings"]}
[galley] {"code":"403","label":"access-denied","request":"N/A","msgs":["D","\"This operation requires reauthentication\""]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings"]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings'"]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings"]}
[galley] {"request":"N/A","targets":"[\"2a18c226-eb2f-4037-8d74-dac55a04417c\",\"65a325d3-5ec9-4669-97be-7605b76894db\"]","msgs":["D","LegalHold.removeSettings'"]}
[galley] {"code":"404","label":"no-team","request":"N/A","msgs":["D","\"team not found\""]}
[galley] {"code":"404","label":"no-team","request":"N/A","msgs":["D","\"team not found\""]}
[galley] {"request":"N/A","targets":"e5fc30a4-a24b-424b-a827-4ba1ee566882","msgs":["D","Teams.addTeamMemberInternal"]}
[galley] {"request":"N/A","targets":"[\"992eb7f9-2c28-4172-97b0-b44b9e5a4119\",\"e5fc30a4-a24b-424b-a827-4ba1ee566882\"]","msgs":["D","LegalHold.createSettings"]}
[galley] {"request":"N/A","targets":"e5fc30a4-a24b-424b-a827-4ba1ee566882","msgs":["D","LegalHold.requestDevice"]}
|
The Also, I see that |
This I cannot change I think. |
the
there are ways to parse this out of the messages list again, but i think it's not worth the effort and the risk of complications with tinylog updates. |
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.
I feel very nit-picky now (sorry!), please let me know if I'm being annoying. The substance of your code is great. If you disagree with any of my comments, fight me! :-)
No need to declare an instance because encoding is only used locally. Furthermore, we avoid an intermediate list being allocated when serializing fields of a log message
it's not easy to change. |
@tiago-loureiro do you want me to add an extra field called |
you could parse it back from the string, i guess... :-) (could you?) |
it's the call to I say we leave it in and add an extra field for debug level as tiago suggested, just in case it'll make analytics easier. |
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.
I'm happy now! (Please do not merge before ci is happy, too! :))
There is an |
* Add logs for team operations * Add logging for legalhold * Json logging (#836) * Allow to set log format The old netstrings option is now deprecated, use logFormat instead. logFormat takes presedence of netstrings if both are set. If none are set, log format defaults to Plain * Implement json renderer for tinylog
* Add json logging and logging (#828) (#836) * Add logs for team operations * Add logging for legalhold * Json logging (#836) * Allow to set log format The old netstrings option is now deprecated, use logFormat instead. logFormat takes presedence of netstrings if both are set. If none are set, log format defaults to Plain * Implement json renderer for tinylog * Specialize the error cases on conversation lookup. (#841) Getting a conversation you left will now give 403 access-denied, not 404 not-found. * Feature Flags in galley options. (#825) * Feature flags in galley options file. * Honour sso feature flag. * Honour legalhold feature flag (test). * Honour legalhold feature flag (handler). * Disable all LH tests if feature is disabled. * Check options settings for feature flag. * Avoid catch-all pattern. Catch-all patterns are not future-proof if constructors for new falvors of "disabled" are added.
No description provided.