1

I have a self hosted web api. I have a log builder helper that populates a LogMessage object with a lot of details from the IOwinRequest object (i.e. requested url, ip address, http method, etc). I use this log helper to populate all of these details whenever the code logs a message.

For example within a service I have have code like this:

Logger.Debug(_logMessageCreator.CreateDebugMessage("Entered XYZ method"));

How can I access the IOwinRequest object from within the LogMessageCreator object?

This is happening outside of a Controller.

jkruer01
  • 2,175
  • 4
  • 32
  • 57

0 Answers0