GitHub user ahouben opened a pull request:
https://github.com/apache/log4net/pull/12
Fixes for the LogicalThreadContext
The current implementation of `LogicalThreadContext` does not flow
correctly through `async/await` calls as described in
http://stackoverflow.com/questions/23316743/log4net-logicalthreadcontext-not-working-as-expected.
This fix honors the shallow-copy-on-write behavior and immutable
requirements when using `CallContext.Logical{Get,Set}Data`. Please see the
accompanied `LogicalThreadContextTest` which is a copy of `ThreadContextTest`
but adds `TestLogicalThreadPropertiesPatternAsyncAwait` and
`TestLogicalThreadStackPatternAsyncAwait` to demonstrate the fix.
Thanks to @stephen-cleary for all the good information on the inner
workings of the async/await mechanism all over the internet.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ahouben/log4net feature/async
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/log4net/pull/12.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12
----
commit 72673fc46aa8abe4fd21018104352b143b7cce8d
Author: Alexander Houben <[email protected]>
Date: 2015-03-05T01:17:28Z
Fix for the LogicalThreadContext{Stack,Properties}
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---