SAP / cf-python-logging-support

Logging library for python applications deployed on SAP Cloud Platform - CloudFoundry environment
Apache License 2.0
17 stars 11 forks source link

Django logging request header issue #62

Open leapin-devops opened 2 years ago

leapin-devops commented 2 years ago

It seems we can't get expected "correlation_id" via DjangoRequestReader class.

def get_http_header(self, request, header_name, default=None):
  if request is None:
      return default

  if header_name in request.META:
      return request.META.get(header_name)
  if header_name.upper() in request.META:
      return request.META.get(header_name.upper())

  return default

Since in Django, header name will be prefixed with "HTTP" and replace "-" to "" in request.META.

Is there any special consideration here?

I am glad to create a PR if it needs fix here.

Viktor-Velkov commented 1 year ago

Hello,

Sorry for the late response. A Pull Request with this fix will be appreciated and we will review it.

BR, Viktor