Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Log user page access and errors. #939

Merged
merged 15 commits into from
Aug 2, 2016
Merged

Conversation

andorp
Copy link
Collaborator

@andorp andorp commented Aug 1, 2016

No description provided.

@andorp
Copy link
Collaborator Author

andorp commented Aug 1, 2016

Partly fixes: #915

@andorp
Copy link
Collaborator Author

andorp commented Aug 1, 2016

We should introduce a new type class to transform values to log message parts and hide sensual information from. I would do that in a different pull request.

The snippet below shows a debug level log:

2016-08-01 15:46:06.777596 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:06.778015 UTC [WARN] [anonym] Not logged in
2016-08-01 15:46:06.782899 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:06.791325 UTC [INFO] [anonym] access to page PageHomeWithLoginPrompt
2016-08-01 15:46:09.885089 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:09.885829 UTC [DEBUG] [xd1yDlnwPX0bUAeRK172WePz] form processed for PageHomeWithLoginPrompt
2016-08-01 15:46:09.894083 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:09.895378 UTC [INFO] [xd1yDlnwPX0bUAeRK172WePz] access to page PageUserSettings
2016-08-01 15:46:09.895728 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:09.896001 UTC [INFO] [xd1yDlnwPX0bUAeRK172WePz] gets access to FormPageRep PageUserSettings
2016-08-01 15:46:11.590972 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:11.593275 UTC [INFO] [xd1yDlnwPX0bUAeRK172WePz] gets access to PageOverviewOfSpaces
2016-08-01 15:46:12.362875 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:12.38825 UTC [INFO] [xd1yDlnwPX0bUAeRK172WePz] gets access to PageOverviewOfWildIdeas
2016-08-01 15:46:13.747441 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:13.776825 UTC [INFO] [xd1yDlnwPX0bUAeRK172WePz] gets access to ViewIdea
2016-08-01 15:46:18.758726 UTC [DEBUG] daemon [logger] recieved a message.
2016-08-01 15:46:18.760478 UTC [ERROR] [xd1yDlnwPX0bUAeRK172WePz] PersistError404 {persistErrorMessage = "Idea"}

@fisx fisx self-assigned this Aug 1, 2016
fisx added 3 commits August 2, 2016 07:38

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann
Conflicts:
	src/Frontend/Page/Admin.hs

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann
this message was turning every log message redundantly into twa.
we should just make sure that all msg daemon clients do enough
debug logging.  i know it's not exactly the same, as this doesn't
show us the message queue delivered, but i think it's close enough,
and the change is justified by the reduced noise.
deleteUser = update . DeactivateUser
deleteUser :: (ActionSessionLog m, ActionPersist m) => AUID User -> m ()
deleteUser uid = do
logEvent INFO $ cshow uid <> " is deactivated"
Copy link
Collaborator

Choose a reason for hiding this comment

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

that sounds like the message i would expect if the user has been deactivated befre, and this action can't do it any more and is warning about it. deactivating user is less confusing. i'll change this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

or, even better, why don't we just show the acid-state transaction type?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, i guess because we have the transaction log for that. (-:

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann
@@ -78,6 +78,9 @@ type CSI' s a = CSI s s a a
csi :: CSI s t a b => Iso s t a b
csi = iso cs cs

cshow :: (Show a, ConvertibleStrings String c) => a -> c
cshow = cs . show
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we eliminated this a while back. Why do you like names so much? (-:

Copy link
Collaborator

Choose a reason for hiding this comment

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

anyway, we can keep it for a while. (-:

fisx added 2 commits August 2, 2016 09:46

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann
@fisx fisx assigned andorp and unassigned fisx Aug 2, 2016
@fisx
Copy link
Collaborator

fisx commented Aug 2, 2016

Lots of noise from me (sorry), but LGTM. This is a big improvement over the current status, thanks!

@andorp can be merged if you and travis are green.

fisx added 2 commits August 2, 2016 09:56

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann
…omplexity)."

This reverts commit b23a76e.

The reason the name introduction is valuable is because it de-duplicates
something that is almost, but not quite, trivial, and it's good if it can
only change in one place, *if* it ever has to change.  See next commit
for evidence in support of this point.

Verified

This commit was signed with the committer’s verified signature.
fisx Matthias Fischmann
@andorp
Copy link
Collaborator Author

andorp commented Aug 2, 2016

LGTM

@fisx fisx merged commit 4f31162 into master Aug 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants