Issue Details (XML | Word | Printable)

Key: LOG4NET-21
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Nicko Cadell
Reporter: Nicko Cadell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Log4net

RemotingAppender fails once NDC becomes empty

Created: 04/Apr/05 02:45 AM   Updated: 08/Mar/06 12:19 AM
Return to search
Component/s: Core
Affects Version/s: 1.2.9
Fix Version/s: 1.2.10

Time Tracking:
Not Specified

Resolution Date: 04/Apr/05 03:23 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #312265 Sun Apr 03 18:01:05 UTC 2005 nicko Added unit test to demonstrate issue LOG4NET-21 from Sam Smoot
Files Changed
MODIFY /logging/log4net/trunk/tests/src/Appender/RemotingAppenderTest.cs

Repository Revision Date User Message
ASF #312267 Sun Apr 03 18:03:29 UTC 2005 nicko Fix for LOG4NET-21. Do not serialise key-value pairs where either the key or value is null
Files Changed
MODIFY /logging/log4net/trunk/src/Util/ReadOnlyPropertiesDictionary.cs

Repository Revision Date User Message
ASF #312268 Sun Apr 03 18:07:17 UTC 2005 nicko Fix for LOG4NET-21. Remove from fixedProperties any key-value pairs where the key or value (or fixed value) is null
Files Changed
MODIFY /logging/log4net/trunk/src/Core/LoggingEvent.cs

Nicko Cadell added a comment - 04/Apr/05 02:49 AM
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).

Nicko Cadell made changes - 04/Apr/05 03:13 AM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Nicko Cadell added a comment - 04/Apr/05 03:23 AM
Fixed by not serialising key-value pairs from the LoggingEvent Properties if the key or value is null.

Nicko Cadell made changes - 04/Apr/05 03:23 AM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Fix Version/s 1.2.10 [ 11128 ]
Nicko Cadell made changes - 08/Mar/06 12:19 AM
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.
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.
Summary RemotingAppender failes once NDC becomes empty RemotingAppender fails once NDC becomes empty
Environment