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

Logging recursively from an Appender not supported for NET_4_0 and MONO_4_0

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.7
    • Fix Version/s: 2.0.8
    • Component/s: Core
    • Labels:
      None

      Description

      When NET_4_0 or MONO_4_0 is defined, log4net uses a ReaderWriterLockSlim with LockRecursionPolicy.NoRecursion. As a result, any attempt to log recursively from within an Appender fail: a System.Threading.LockRecursionException is thrown and swallowed by the log4net Core.

      Other versions use a ReaderWriterLock and allow recursion.

      The following branch adds a unit test that shows this inconsistent behaviour. The test fails for NET_4_0 or MONO_4_0 and passes for other versions:

      https://github.com/JJoe2/log4net/tree/RecursiveLogging

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              joejoe Joe

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment