You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Andrei Stryia (JIRA)" <ji...@apache.org> on 2018/09/26 14:09:00 UTC

[jira] [Comment Edited] (LOG4NET-487) Control mutex type

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

Andrei Stryia edited comment on LOG4NET-487 at 9/26/18 2:08 PM:
----------------------------------------------------------------

[~nachbarslumpi], I've manage to build the branch with netstandard target.
But when I'm starting my app, it fails with the following error:
{code}
log4net:ERROR Exception while rendering object of type [Logging.LogMessage]
System.MethodAccessException: Attempt by security transparent method 'log4net.ObjectRenderer.RendererMap.SearchTypeAndInterfaces(System.Type)' to access security critical method 'System.Reflection.TypeExtensions.GetInterfaces(System.Type)' failed.

Assembly 'log4net, Version=2.0.9.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model.  Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
   at log4net.ObjectRenderer.RendererMap.SearchTypeAndInterfaces(Type type)
   at log4net.ObjectRenderer.RendererMap.Get(Type type)
   at log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)
{code}




was (Author: andrei_s):
[~nachbarslumpi]], I've manage to build the branch with netstandard target.
But when I'm starting my app, it fails with the following error:
{code}
log4net:ERROR Exception while rendering object of type [Logging.LogMessage]
System.MethodAccessException: Attempt by security transparent method 'log4net.ObjectRenderer.RendererMap.SearchTypeAndInterfaces(System.Type)' to access security critical method 'System.Reflection.TypeExtensions.GetInterfaces(System.Type)' failed.

Assembly 'log4net, Version=2.0.9.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model.  Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
   at log4net.ObjectRenderer.RendererMap.SearchTypeAndInterfaces(Type type)
   at log4net.ObjectRenderer.RendererMap.Get(Type type)
   at log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer)
{code}



> Control mutex type
> ------------------
>
>                 Key: LOG4NET-487
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-487
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 1.2.14, 1.3.0
>            Reporter: NN
>            Assignee: Dominik Psenner
>            Priority: Major
>
> The only missing feature is an option for choosing Local (per session) or Global (per machine) mutex.
> The current code just uses the filename for mutex which good but it always makes a local one, so if you have two sessions you cannot synchronize them.
> Default is Local for backward compatibility.
> See Note in: https://msdn.microsoft.com/en-us/library/system.threading.mutex%28v=vs.110%29.aspx 
> I think it can be an option like
> <RollingMutexType value="Global" /> 
> or something like that.
> It also applies to FileAppender mutex .
> <LockingModel InterProcessLock>
>   <LockingMutexType value="Global" />
> </..>
> See issue #485 for reference.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)