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

4. Improve logging on session related errors #226

Conversation

johanib
Copy link
Contributor

@johanib johanib commented Nov 21, 2024

Prior to this change there we weren't able to keep track of sessions that got lost.
This change allows us to see every time a session is created and distinguish them by their correlation id.
Log an error on a route that requires an active session when there is none

Prior to this change all routes were able to called, even though the user might not have had an active session
This change will start logging errors when the session wasn't found, or is in an unexpected state

Prior to this change session information got lost. We had no way of tracking down what happened to user sessions in the logs.
This change logs whether a session existed and if it's in a valid state. Log information is enriched with a correlation id to be able to distinguish them.

See https://www.pivotaltracker.com/n/projects/1163646/stories/188205214

@johanib johanib changed the title Log every time a session is created 4. Log every time a session is created Nov 21, 2024
@johanib johanib force-pushed the feature/4.log-more-session-errors branch 3 times, most recently from fd46dc7 to 428cdd2 Compare November 21, 2024 12:35
@johanib johanib changed the title 4. Log every time a session is created 4. Improve logging on session related errors Nov 21, 2024
@johanib johanib force-pushed the feature/implement-session-required-atttribute branch from 44e890a to 0e18752 Compare November 21, 2024 13:26
Prior to this change there we weren't able to keep track of sessions that got lost.
This change allows us to see every time a session is created and distinguish them by their correlation id.
Log an error on a route that requires an active session when there is none

Prior to this change all routes were able to called, even though the user might not have had an active session
This change will start logging errors when the session wasn't found, or is in an unexpected state

Prior to this change session information got lost. We had no way of tracking down what happened to user sessions in the logs.
This change logs whether a session existed and if it's in a valid state. Log information is enriched with a correlation id to be able to distinguish them.

See https://www.pivotaltracker.com/n/projects/1163646/stories/188205214
return null;
}

return substr(hash('sha256', $sessionCookie.$this->correlationIdSalt), 0, 8);
Copy link
Member

Choose a reason for hiding this comment

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

This is now in spec with @pmeulen s request found here: #210 (comment)

@pmeulen pmeulen merged commit 98f4da6 into feature/implement-session-required-atttribute Nov 29, 2024
2 checks passed
@pmeulen pmeulen deleted the feature/4.log-more-session-errors branch November 29, 2024 10:37
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.

4 participants