How do I get .NETs System.web framework to write unauthorized requests to the log file

33 Views Asked by At

You'll have to pardon me if this is a dumb question - I'm trying to help out on a .NET project but I've never done any .NET

We have some Java-based REST services trying to do a GET with NTLM authentication to a .NET endpoint. What we are seeing is that requests that authentication show up in the log, but requests that fail do NOT show up in the log.

We want to see the failed requests in the log and if possible some sort of "reason" as to why they were rejected (bad NTLM domain, bad credentials, network failure to authentication service, etc.)

How do we do that?

Here's an extract from the code for the endpoint:

using System.Net.Http;
using System.Reflection;
using System.Web.Http;


[RoutePrefix("api/config")]
public sealed class ConfigController : ApiController {
    [HttpGet]
    [Route("version")]
    public IHttpActionResult GetVersion() {
        return Ok(Build.InformationalVersion);
    }
0

There are 0 best solutions below