-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
logging: Experimental except option for delete filter
#3711
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
Closed
francislavoie
wants to merge
1
commit into
caddyserver:master
from
francislavoie:filter-delete-except
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it's a struct/object with fields instead of a map with keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. I didn't look that deeply to see how that would work. I was primarily concerned with the
headerusecase because that sounds like the most common usecase. Can you think of an example field where that would apply, that I could test for?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
requestfield (parent ofheader, I think) is a struct/object. Granted, they're not as dynamic since they're strongly typed, but I can see users might want to delete the whole object except for one property.Honestly this is fine, we can do more based on feature requests if necessary.
Is this still a draft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're happy with this, then cool.
I'm still a bit concerned about the part where we're straight up modifying the
http.Request, seems "destructive". But if this is always the last thing in the middleware chain, then I guess it's fine? But 😬Anyways - we should merge the other
filterPR first, then I'll un-draft this and rebase, to keep those separate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay... thanks for bringing that up again. Yeah, modifying the underlying map is going to be a problem. You can verify this with:
(Obviously in conjunction with filtered logs.) And I bet you will not see anything in the response, despite clients setting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, confirmed.
respond {header.User-Agent}returns empty whenexceptis used.I don't know how we could do this otherwise...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this isn't working is because it's a hack on the design. The proper way to do this is to have some other Caddy app module (or any other external log aggregator service) ingest the logs and filter them after being encoded. I don't know another way to do it.