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

Would be nice to avoid accessing the Thread.CurrentPrincipal

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.8
    • None
    • Builds
    • None
    • win 10 x64, otherwise it seems to be not an environmental issue

    Description

      Hello,

      We had a weird issue in our product: at one point we set the default principal for newly created threads using AppDomain.CurrentDomain.SetThreadPrincipal(some_own_principal), however, the new threads were using the generic principal. After a fair amount of internet digging it turned out that IF the Thread.CurrentPrincipal is accessed, the SetThreadPrincipal won't set anything, it will just silently fail. You can read more about this issue here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/f9a67b32-7c9b-4893-bf08-5a02203318d5/weird-threadcurrentprincipal-behavior?forum=netfxbcl

      As it turned out the only place where the Thread.CurrentPrincipal is used, is where we initlialize Log4Net.

      Even though this is rather an issue on the .net library, IF there is away, it would be nice to avoid accessing the thread.currentprincipal

      cheers,
      Lehel

      Attachments

        1. stacktrace.jpg
          171 kB
          Lehel Bara

        Activity

          People

            Unassigned Unassigned
            blehel Lehel Bara
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: