You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Roman Bäriswyl (JIRA)" <ji...@apache.org> on 2017/09/08 13:46:00 UTC

[jira] [Commented] (LOG4NET-574) LogicalThreadContextProperties uses CallContext.GetData and not CallContext.LogicalGetData

    [ https://issues.apache.org/jira/browse/LOG4NET-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16158656#comment-16158656 ] 

Roman Bäriswyl commented on LOG4NET-574:
----------------------------------------

Actually I looked at an old source file.
The newest one looks like:
{code:csharp}
 #if NETSTANDARD1_3
                         return AsyncLocalDictionary.Value;
 #elif NET_2_0 || MONO_2_0 || MONO_3_5 || MONO_4_0
                         return CallContext.LogicalGetData(c_SlotName) as PropertiesDictionary;
 #else
                         return CallContext.GetData(c_SlotName) as PropertiesDictionary;
 #endif
{code}
Why does only Net2.0 use the {{LogicalGetData}} and all others the {{GetData}}?

> LogicalThreadContextProperties uses CallContext.GetData and not CallContext.LogicalGetData
> ------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-574
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-574
>             Project: Log4net
>          Issue Type: Improvement
>            Reporter: Roman Bäriswyl
>
> As the title says, the {{LogicalThreadContextProperties}} uses {{CallContext.GetData}} and not {{CallContext.LogicalGetData}}. The latter one can be handy if used in async environments (see http://blog.stephencleary.com/2013/04/implicit-async-context-asynclocal.html).
> I'm not sure if the {{LogicalThreadContextProperties}} should be changed to {{LogicalGetData}} or if another {{*Properties}} object should be created with the {{LogicalGetData}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)