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

Add debug logging for endpoints that don't have a user but affect a user #856

Merged
merged 2 commits into from
Sep 30, 2019

Conversation

arianvp
Copy link
Contributor

@arianvp arianvp commented Sep 13, 2019

E.g. this is useful to see if someone is actively trying to reset
someone's password.

E.g.  this is useful to see if someone is actively trying to reset
someone's password.
Copy link
Contributor

@tiago-loureiro tiago-loureiro left a comment

Choose a reason for hiding this comment

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

For the future though, I think we should move all these log calls to a separate function like:

auditLog :: (MonadLogger m) => UserId -> [UserId] -> String ->  m ()
auditLog actor targets action =
  -- We probably want a different log level
  Log.debug $ field "user" (toByteString actor)
            . field "targets" (map toByteString targets) -- "with an intercalated comma..."
            . field "action" (Log.val action)
            . msg "a little more descriptive"

Even potentially we want a different log level or something along these lines...

@arianvp arianvp merged commit dbebc7c into develop Sep 30, 2019
@arianvp arianvp deleted the more-more-debug-logging branch September 30, 2019 09:41
@arianvp arianvp mentioned this pull request Sep 30, 2019
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.

2 participants