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

Feat/add debug log settings #44

Closed
wants to merge 4 commits into from
Closed

Conversation

SamMHD
Copy link
Collaborator

@SamMHD SamMHD commented Mar 1, 2024

No description provided.

@navidnabavi
Copy link
Contributor

This is great for quick debugging! It could be even better if we could send access logs to an external system like ELK stack or Prometheus. Storing them for a day or a week might work well.

@navidnabavi navidnabavi self-assigned this Mar 6, 2024
@@ -145,6 +148,17 @@ func (a *Authenticator) Check(ctx context.Context, request *Request) (finalRespo
start_time := time.Now()
wsvc, ns, reason := readRequestContext(request)

// access logs
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the most usages of loggers there's a convention that developers leverage log levels filtering to the logging library and most of the time there's not a condition to check print a log or not.
for example you always call logs but a configuration value sets the logging library to print the value or not.
This is a logrus example:
https://stackoverflow.com/questions/47514812/how-to-use-debug-log-in-golang

Copy link
Collaborator Author

@SamMHD SamMHD Mar 30, 2024

Choose a reason for hiding this comment

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

Dear, It's not production ready yet. we will change it later. sorry for early review request. and btw, we won't merge this as we already discovered the issue with propagation.

Just debugging and reason beyond this if clause is that current logging library used in Cerberus does not support debug level

@SamMHD SamMHD closed this Mar 30, 2024
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