I'm working on an API built on Node JS following the clean architecture guidelines, Also I'm using aws API GW which provides a request id for every request made to the API and I would like to add this request id to the logging metadata.
So, I currently have an abstraction of the logger and I'm injecting a concrete implementation of this logger into the application layers using some kind of DI. Also, I'm injecting services and db adapter using the same DI.
I would like to know if anyone can help with a clean way to pass the request id metadata into the logger without having to instance services and db adapter every time a request came to the API in order to inject the logger with the metadata in the constructor of this components.