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

Use slog for structured, standardised logs #121

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

gregtyler
Copy link
Contributor

Mostly just switching out methods, but also use more appropriate log levels in a few places

For CTC-138 #patch

Mostly just switching out methods, but also use more appropriate log levels in a few places

For CTC-138 #patch
@@ -50,11 +53,11 @@ type Lambda struct {
func (l *Lambda) HandleEvent(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
_, err := l.verifier.VerifyHeader(req)
if err != nil {
l.logger.Print("Unable to verify JWT from header")
l.logger.Info("Unable to verify JWT from header")
Copy link
Contributor

Choose a reason for hiding this comment

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

How come we would log this at info level rather than error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error-level logs are for things which shouldn't go wrong, since they trigger alarms. This is just informational, since LPA store doesn't particularly care about a unauthorised request.

@gregtyler gregtyler merged commit f13f291 into main Mar 7, 2024
21 checks passed
@gregtyler gregtyler deleted the CTC-138-standardised-logging branch March 7, 2024 10:38
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