Erik Källén created LOG4NET-560:

             Summary: UnauthorizedAccessException in RollingFileAppender when 
acquiring a mutex
                 Key: LOG4NET-560
             Project: Log4net
          Issue Type: Bug
            Reporter: Erik Källén

I have a setup where I want two processes, running as different user accounts 
to log to the same file.

I have set up the file permissions so they work, but the second process that 
starts cannot perform the logging due to this error:

log4net:ERROR Could not create Appender [myAppender] of type 
[log4net.Appender.RollingFileAppender]. Reported error follows.
System.UnauthorizedAccessException: Access to the path 'E__Log_MyLog.log' is 
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
 code, CleanupCode backoutCode, Object userData)
   at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean 
initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, 
Boolean& createdNew, MutexSecurity mutexSecurity)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at log4net.Appender.RollingFileAppender.ActivateOptions()

I think the mutex should be created with access for Everyone, and that would 
solve the problem.

This message was sent by Atlassian JIRA

Reply via email to