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

Log custom headers #24

Open
lerela opened this issue Aug 14, 2020 · 3 comments
Open

Log custom headers #24

lerela opened this issue Aug 14, 2020 · 3 comments

Comments

@lerela
Copy link

lerela commented Aug 14, 2020

Some requests might include additional, useful information about the client in some custom HTTP header, say X-Client-Name and X-Client-Version. There is no way to currently get that information.

I see two main approaches, both based on a JSON field to store headers (that would restrict this feature to the DB backends that support JSON fields, but it's already been suggested to use them in #2):

  • Should we log all headers? This could significantly increase the size of a log entry.
  • Should we allow the user to specify which headers he's interested in? In settings? This requires some setup but allows to target only useful headers, so that's my favorite approach so far.
@lingster
Copy link
Owner

lingster commented Sep 5, 2020

I think having an option in settings to determine a list of headers to store.

Also I think storing this data is a json field is the most flexible. Django 3.1 now supports JSONfields for all db backends: https://docs.djangoproject.com/en/3.1/releases/3.1/#jsonfield-for-all-supported-database-backends

@cyberbudy
Copy link

+1

@honeydev
Copy link

It's realy important feature.

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

No branches or pull requests

4 participants