So I'm trying to find out during runtime which parent method has called a method which is writing to a log file. I have many endpoints using [HttpGet]/[HttpPost] and I would like to know which one is being calling while being much further down the call stack. Now I've looked into using a stack trace/frames but it yielded very little usable results. I've also looked at using CallerMemberName but its seems to only go up one level.
I.e [HttpGet] GetAllInfo calls GetTextInfo calls GetTextInfoFromDB1 calls {the logger which writes}.
I want to know how to identify that it was GetAllInfo who was initially called, which caused the logger to write. The final catch is that I'm not about to edit a few hundred methods.