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

RemotingAppender fails once NDC becomes empty

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.9
    • Fix Version/s: 1.2.10
    • Component/s: Core
    • Labels:
      None

      Description

      If an NDC, or any form of Context.Stack, is set on the current thread and then becomes empty the RemotingAppender will fail. This is caused by the LoggingEvent Properties failing to serialise due to an unexpected null value in the properties map.

      The issue is caused by the GetObjectData method of log4net.Util.ReadOnlyPropertiesDictionary not coping with null values.

      Issue reported by Sam Smoot.

        Activity

        Hide
        nicko Nicko Cadell added a comment -

        The ReadOnlyPropertiesDictionary should not serialise key-value pairs with a null key or value.

        Null values properties should be stripped from the LoggingEvent composite properties (after allowing for overriding).

        Show
        nicko Nicko Cadell added a comment - The ReadOnlyPropertiesDictionary should not serialise key-value pairs with a null key or value. Null values properties should be stripped from the LoggingEvent composite properties (after allowing for overriding).
        Hide
        nicko Nicko Cadell added a comment -

        Fixed by not serialising key-value pairs from the LoggingEvent Properties if the key or value is null.

        Show
        nicko Nicko Cadell added a comment - Fixed by not serialising key-value pairs from the LoggingEvent Properties if the key or value is null.

          People

          • Assignee:
            nicko Nicko Cadell
            Reporter:
            nicko Nicko Cadell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development