Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-617

Logging IP address of incoming request for multiple thread.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Information Provided
    • Affects Version/s: 2.0.8
    • Fix Version/s: 2.1.0
    • Component/s: Layouts
    • Labels:
      None

      Description

      Hi,

      I am trying to log the ip address of incoming request. For logging i am using log4net 2.0.8.

      I used Application_BeginRequest method in global.asax to save the ip address of incoming request. However it seems like not working for multiple thread for same user.

       

      // code placeholder
      void Application_BeginRequest(object sender, EventArgs e)
      
      { log4net.ThreadContext.Properties["addr"] = Request.UserHostAddress; }
      

      logs look like

      // code placeholder
      213.136.59.97 2018-11-30 07:35:33,561 [14] DEBUG Conference - Kitty:  visaBoka LoadPrintTimeline end: 
      (null) 2018-11-30 07:36:37,968 [32] DEBUG Conference - Kitty: Statistik  btnVisa_Click started

       

        Attachments

          Activity

            People

            • Assignee:
              nachbarslumpi Dominik Psenner
              Reporter:
              shahid.majeed Shahid Majeed
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: