Closed zeroaltitude closed 3 years ago
ok not sure if I understand what you mean. Right now, the only way to specify headers is by setting json_logging.CORRELATION_ID_HEADERS. So u think it makes more sense to have a DEFAULT_CORRELATION_ID_HEADERS and let that overridden by an env var called CORRELATION_ID_HEADERS ?
From a practical standpoint, I would say that the request-id headers config will most likely be the same across environments. So it convenient to have it hardcoded in the application source code
I can fork it and show you what I mean in a pull request. Also, as these variables are ones I absolutely need to modify in an AWS lambda environment, I can guarantee that having flexibility to modify these is useful.
ok cool, now I understand more. looking forward to your PR though
closed as no response from owner, can be opened again if still interested
In the code, to set variables such as CORRELATION_ID_HEADERS, you manually overwrite them with global values using the namespace itself. This is not a best practice in python. Instead, have DEFAULT_CORRELATION_ID_HEADERS and let that be overridden by CORRELATION_ID_HEADERS as an environment variable.