epimorphics / json-rails-logger

A custom rails logger that outputs JSON instead of raw text
MIT License
1 stars 1 forks source link

Don't log the request ID created by ActionDispatch::RequestId #22

Closed ijdickinson closed 3 years ago

ijdickinson commented 3 years ago

Rails applies an invariant to incoming requests that the Rack request request_id always has a value. This defaults to the X-Request-ID header, but otherwise a request ID is assigned internally.

@andrew-pickin-epi and @der have asked that this internally assigned request ID is not logged when logging messages via the json-rails-logger. Looking at the code, I think this means accessing the headers array on the incoming request directly, rather than relying on the request_id method. So the thread local variable is only set if the incoming request has an X-Request-Id header.

bogdanadrianmarc commented 3 years ago

This should be in the 0.2.2 release 👍