Conversation
mraerino
left a comment
There was a problem hiding this comment.
sadly, this is not what i had in mind.
if you implement it like this, mailme still has a central logger which will not have different fields based on the request.
you need to pass in the logger that you have as part of a request handler, e.g. where the actual email is sent.
this might mean having to change mailme to actually accept a logger in that place.
also, I don't even know if the safe http client will be able to get the logger in that way.
a much better way to do this might be to get the logger from the request context, since that can easily be added to an existing http client, but none if the components in play (safeHTTPClient or mailme) are made for this currentyl
sorry for sending you down this road 🙈
this is a good start though, because it at least adds some service fundamentals to the logline
Instead of creating a new logger, pass a logger based on the current request to the Mailer.