Logging with IIS7 [Answered]RSS

3 replies

Last post Aug 03, 2012 02:56 AM by claire.allali

  • Logging with IIS7

    Sep 05, 2008 06:01 AM|Paracetamol|LINK

    Hi, is there a way to don't log query coming from certain ip like localhost ?
  • Re: Logging with IIS7

    Sep 05, 2008 02:13 PM|ksingla|LINK

    I don't think this is possible. You can use logparser to filter these out when you are aggregating the data but you cannot turn off logging for certain IPs.

    Thanks,
    Kanwal

  • Re: Logging with IIS7

    Sep 05, 2008 02:31 PM|anilr|LINK

    You definitely cannot do it with just configuration - you can do it if you are willing to write some code - something like below

    REQUEST_NOTIFICATION_STATUS
    MyModule::OnSendResponse(
      IHttpContext *          pHttpContext,
      ISendResponseProvider * pProvider
    )
    {
      if (!pProvider->GetReadyToLogData())
      {
        return RQ_NOTIFICATION_CONTINUE;
      }

      hr = pHttpContext->GetServerVariable("REMOTE_ADDR", &pszAddr, &cchAddr);
      if (ShouldClientIPNotBeLogged(pszAddr))
      {
        pProvider->SetLogData(NULL);
      }

      return RQ_NOTIFICATION_CONTINUE;
    }

     

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: Logging with IIS7

    Aug 03, 2012 02:56 AM|claire.allali|LINK

    Hello, I tried your solution, but IIS stops logging after the first call to SetLogData(NULL). Are you sure this should work ? Thank you in advance for your answer, Claire