title: Keeping track of internal applications using ASP.NET Web APIs (Logging)
body: <p>I currently have a lot of Web APIs that are being used by various applications. All of the APIs are using ASP.NET Web API 2 with 4.6 .NET framework. I want to be able to keep track of all the different applications that are using a specific API.</p>
  
  <p>Example:</p>
  
  <p>Lets say I have the following API:</p>
  
  <ul>
  <li><em>Employees API</em> - gets all employee(s)</li>
  </ul>
  
  <p>And I have the following applications that call the <em>Employees API</em></p>
  
  <ul>
  <li><strong>Employee Management System</strong> - located at <code>/intranet/employee/add</code></li>
  <li><strong>Time Off Request Form</strong> - located at <code>/intranet/timeoff.aspx</code></li>
  </ul>
  
  <p>The <strong>Employee Management System</strong> calls the <em>Employees API</em> using HttpClient in C# code.</p>
  
  <p>The <strong>Time Off Request Form</strong> calls the <em>Employees API</em> using an ajax call in JavaScript.</p>
  
  <hr>
  
  <p>I want to keep a log of all the applications that are using a Web API and preferably what action they are calling. What is the best way to achieve this? </p>
  
  <p>Is there a way to get the Callers URI? </p>
  
  <p>From the Web API is it possible to know that <code>/intranet/timeoff.aspx</code> is calling the the add employee action on the <em>Employee API</em></p>