Cristian (JIRA | 23 May 18:03 2016
Picon

[jira] [Updated] (LOG4NET-515) Archive of old versions


     [
https://issues.apache.org/jira/browse/LOG4NET-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cristian updated LOG4NET-515:
-----------------------------
    Description: 
As mentioned at [https://logging.apache.org/log4net/download_log4net.cgi#Archives], "Release
1.2.11 and all more recent releases \[SHOULD BE] available from the Apache Software Foundation's
[distribution archive|http://archive.apache.org/dist/logging/log4net/]." This is however not
the case anymore: only the latest (1.2.15) binaries are there. Mirrors don't have them either. The
previous 2 versions (1.2.9 and 1.2.10) are still available from the Incubator, so this feels weird...

Also, the page at https://logging.apache.org/log4net/log4net-1.2.11/download.html has a few broken
links because of this situation. Presumably, all 3 other similar pages have broken links too.

  was:
As mentioned at https://logging.apache.org/log4net/download_log4net.cgi#Archives , "Release
1.2.11 and all more recent releases [SHOULD BE] available from the Apache Software Foundation's
distribution archive." [ http://archive.apache.org/dist/logging/log4net/ ] This is however not the
case anymore: only the latest (1.2.15) binaries are there. Mirrors don't have them either. The previous 2
versions (1.2.9 and 1.2.10) are still available from the Incubator, so this feels weird...

Also, the page at https://logging.apache.org/log4net/log4net-1.2.11/download.html has a few broken
links because of this situation. Presumably, all 3 other similar pages have broken links too.

> Archive of old versions
> -----------------------
>
>                 Key: LOG4NET-515
(Continue reading)

Cristian (JIRA | 23 May 18:00 2016
Picon

[jira] [Created] (LOG4NET-515) Archive of old versions

Cristian created LOG4NET-515:
--------------------------------

             Summary: Archive of old versions
                 Key: LOG4NET-515
                 URL: https://issues.apache.org/jira/browse/LOG4NET-515
             Project: Log4net
          Issue Type: Improvement
    Affects Versions: 1.2.14, 1.2.13, 1.2.12, 1.2.11
            Reporter: Cristian

As mentioned at https://logging.apache.org/log4net/download_log4net.cgi#Archives , "Release
1.2.11 and all more recent releases [SHOULD BE] available from the Apache Software Foundation's
distribution archive." [ http://archive.apache.org/dist/logging/log4net/ ] This is however not the
case anymore: only the latest (1.2.15) binaries are there. Mirrors don't have them either. The previous 2
versions (1.2.9 and 1.2.10) are still available from the Incubator, so this feels weird...

Also, the page at https://logging.apache.org/log4net/log4net-1.2.11/download.html has a few broken
links because of this situation. Presumably, all 3 other similar pages have broken links too.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Michael Ji | 21 May 19:41 2016
Picon

Log4Net remotelogging issue

Good Afternoon:

I found Log4Net stopped the App when using remotelogging.
 
By digging into its’ source code, I found following code line will block App who use Log4Net if no UDP protocol message is returned from remote server (maybe there is a network issue that remote server doesn’t send reply back)
 
this.Client.Send(buffer, buffer.Length, this.RemoteEndPoint);
 
                    //IPEndPoint object will allow us to read datagrams sent from any source.
                    IPEndPoint RemoteIpEndPoint_receive = this.RemoteEndPoint; //new IPEndPoint(IPAddress.Any, 0);
 
                    // Blocks until a message returns on this socket from a remote host.
                    Byte[] receiveBytes = this.Client.Receive(ref RemoteIpEndPoint_receive);
                    string returnData = Encoding.ASCII.GetString(receiveBytes);
 
 
If I commented out the highlighted two lines, it runs good.
 
So, my concerns are:
 
1.       Is there any side effect if we commented out these two lines?
 
2.       Is commented out these two line making Log4Net more robust? (since UDP is not 100% reliable by nature)
 

thanks,

Michael
Aaron Mell (JIRA | 16 May 22:37 2016
Picon

[jira] [Updated] (LOG4NET-514) log4net killing w3wp worker process in IIS


     [
https://issues.apache.org/jira/browse/LOG4NET-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Mell updated LOG4NET-514:
-------------------------------
    Description: 
After upgrading to 1.2.15 several dev's have reported W3WP crashing. Attached a debugger returns a NRE
inside of log4net. 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<log4net>		
		<appender name="StandardRollingFileAppender" type="log4net.Appender.RollingFileAppender">
			<lockingModel type="log4net.Appender.FileAppender+InterProcessLock"/>
			<file value="C:\Logs\Client.log" />
			<appendToFile value="true" />
			<rollingStyle value="Size" />
			<maxSizeRollBackups value="10" />
			<maximumFileSize value="2MB" />
			<staticLogFileName value="true" />
			<layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%date |*| %thread |*| %-5level |*| %logger |*|
%property{CorrelationID} |*| %property{Id1} |*| %property{Id2} |*| %property{Id3} |*|
%message%newline" />
			</layout>
		</appender>
		<appender name="DebugAppender" type="log4net.Appender.DebugAppender">
			<immediateFlush value="true" />
			<layout type="log4net.Layout.SimpleLayout" />
		</appender>
		<root>
			<level value="ERROR" />
			<appender-ref ref="DebugAppender" />
		</root>		
		<logger name="RootNameSpace" additivity="false">
			<level value="DEBUG" />
			<appender-ref ref="StandardRollingFileAppender" />			
			<appender-ref ref="DebugAppender" />
		</logger>
	</log4net>
</configuration>

  was:
After upgrading to 1.2.15 several dev's have reported W3WP crashing. Attached a debugger returns a NRE
inside of log4net. 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<log4net>		
		<appender name="StandardRollingFileAppender" type="log4net.Appender.RollingFileAppender">
			<lockingModel type="log4net.Appender.FileAppender+InterProcessLock"/>
			<file value="C:\Logs\Client.log" />
			<appendToFile value="true" />
			<rollingStyle value="Size" />
			<maxSizeRollBackups value="10" />
			<maximumFileSize value="2MB" />
			<staticLogFileName value="true" />
			<layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%date |*| %thread |*| %-5level |*| %logger |*|
%property{CorrelationID} |*| %property{BankIdentifier} |*| %property{BankName} |*|
%property{UserIdentifier} |*| %message%newline" />
			</layout>
		</appender>
		<appender name="DebugAppender" type="log4net.Appender.DebugAppender">
			<immediateFlush value="true" />
			<layout type="log4net.Layout.SimpleLayout" />
		</appender>
		<root>
			<level value="ERROR" />
			<appender-ref ref="DebugAppender" />
		</root>		
		<logger name="RootNameSpace" additivity="false">
			<level value="DEBUG" />
			<appender-ref ref="StandardRollingFileAppender" />			
			<appender-ref ref="DebugAppender" />
		</logger>
	</log4net>
</configuration>

> log4net killing w3wp worker process in IIS
> ------------------------------------------
>
>                 Key: LOG4NET-514
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-514
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.15
>         Environment: Windows 8 / Server 2012. Using Common.Logging and Common.Logging1215
>            Reporter: Aaron Mell
>            Priority: Blocker
>
> After upgrading to 1.2.15 several dev's have reported W3WP crashing. Attached a debugger returns a NRE
inside of log4net. 
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> 	<log4net>		
> 		<appender name="StandardRollingFileAppender" type="log4net.Appender.RollingFileAppender">
> 			<lockingModel type="log4net.Appender.FileAppender+InterProcessLock"/>
> 			<file value="C:\Logs\Client.log" />
> 			<appendToFile value="true" />
> 			<rollingStyle value="Size" />
> 			<maxSizeRollBackups value="10" />
> 			<maximumFileSize value="2MB" />
> 			<staticLogFileName value="true" />
> 			<layout type="log4net.Layout.PatternLayout">
> 				<conversionPattern value="%date |*| %thread |*| %-5level |*| %logger |*|
%property{CorrelationID} |*| %property{Id1} |*| %property{Id2} |*| %property{Id3} |*|
%message%newline" />
> 			</layout>
> 		</appender>
> 		<appender name="DebugAppender" type="log4net.Appender.DebugAppender">
> 			<immediateFlush value="true" />
> 			<layout type="log4net.Layout.SimpleLayout" />
> 		</appender>
> 		<root>
> 			<level value="ERROR" />
> 			<appender-ref ref="DebugAppender" />
> 		</root>		
> 		<logger name="RootNameSpace" additivity="false">
> 			<level value="DEBUG" />
> 			<appender-ref ref="StandardRollingFileAppender" />			
> 			<appender-ref ref="DebugAppender" />
> 		</logger>
> 	</log4net>
> </configuration>

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Aaron Mell (JIRA | 16 May 22:37 2016
Picon

[jira] [Created] (LOG4NET-514) log4net killing w3wp worker process in IIS

Aaron Mell created LOG4NET-514:
----------------------------------

             Summary: log4net killing w3wp worker process in IIS
                 Key: LOG4NET-514
                 URL: https://issues.apache.org/jira/browse/LOG4NET-514
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.15
         Environment: Windows 8 / Server 2012. Using Common.Logging and Common.Logging1215
            Reporter: Aaron Mell
            Priority: Blocker

After upgrading to 1.2.15 several dev's have reported W3WP crashing. Attached a debugger returns a NRE
inside of log4net. 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<log4net>		
		<appender name="StandardRollingFileAppender" type="log4net.Appender.RollingFileAppender">
			<lockingModel type="log4net.Appender.FileAppender+InterProcessLock"/>
			<file value="C:\Logs\Client.log" />
			<appendToFile value="true" />
			<rollingStyle value="Size" />
			<maxSizeRollBackups value="10" />
			<maximumFileSize value="2MB" />
			<staticLogFileName value="true" />
			<layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%date |*| %thread |*| %-5level |*| %logger |*|
%property{CorrelationID} |*| %property{BankIdentifier} |*| %property{BankName} |*|
%property{UserIdentifier} |*| %message%newline" />
			</layout>
		</appender>
		<appender name="DebugAppender" type="log4net.Appender.DebugAppender">
			<immediateFlush value="true" />
			<layout type="log4net.Layout.SimpleLayout" />
		</appender>
		<root>
			<level value="ERROR" />
			<appender-ref ref="DebugAppender" />
		</root>		
		<logger name="RootNameSpace" additivity="false">
			<level value="DEBUG" />
			<appender-ref ref="StandardRollingFileAppender" />			
			<appender-ref ref="DebugAppender" />
		</logger>
	</log4net>
</configuration>

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Michael Walters (JIRA | 13 May 22:47 2016
Picon

[jira] [Created] (LOG4NET-513) Support different Windows logon types during impersonation

Michael Walters created LOG4NET-513:
---------------------------------------

             Summary: Support different Windows logon types during impersonation
                 Key: LOG4NET-513
                 URL: https://issues.apache.org/jira/browse/LOG4NET-513
             Project: Log4net
          Issue Type: Improvement
          Components: Core
            Reporter: Michael Walters
            Priority: Minor

The WindowsSecurityContext.cs class currently hard-codes the login type as "Interative" when calling
the Windows API LogonUser().  It would be nice to be able to specify any of the valid logon types to use in case
the application using log4net must adhere specific security constraints.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Blake Raymond (JIRA | 11 May 20:57 2016
Picon

[jira] [Comment Edited] (LOG4NET-485) RollingFileAppender cannot be used by multiple process


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

Blake Raymond edited comment on LOG4NET-485 at 5/11/16 6:56 PM:
----------------------------------------------------------------

We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as Local System and the other is IIS running as Network Service, with default
permissions for those users on Windows Server 2012. We are finding that if the Local System process is the
one to create the named mutex for rolling, the Network Service process is unable to open it and receives an
access denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if
the Network Service process creates the mutex, the Local System process is able to open it.

{noformat}
System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()
{noformat}
<call stack truncated>

was (Author: blake.raymond):
We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as SYSTEM and the other is IIS running as NETWORK SERVICE, with default
permissions for those users on Windows Server 2012. We are finding that if the SYSTEM process is the one to
create the named mutex for rolling, the NETWORK SERVICE process is unable to open it and receives an access
denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if the
NETWORK SERVICE process creates the mutex, the SYSTEM process is able to open it.

{noformat}
System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()
{noformat}
<call stack truncated>

> RollingFileAppender cannot be used by multiple process
> ------------------------------------------------------
>
>                 Key: LOG4NET-485
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-485
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13, 1.2.14, 1.3.0
>            Reporter: NN
>            Assignee: Dominik Psenner
>             Fix For: 1.2.14
>
>
> RollingFileAppender doesn't acquire lock when rolling takes place.
> As a consequence running multiple instances of the same program rewrites the same log file instead of
making a roll for everyone.
> There is FileAppender.InterProcessLock but it only protects writes and not rolls.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Blake Raymond (JIRA | 10 May 23:40 2016
Picon

[jira] [Comment Edited] (LOG4NET-485) RollingFileAppender cannot be used by multiple process


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

Blake Raymond edited comment on LOG4NET-485 at 5/10/16 9:40 PM:
----------------------------------------------------------------

We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as SYSTEM and the other is IIS running as NETWORK SERVICE, with default
permissions for those users on Windows Server 2012. We are finding that if the SYSTEM process is the one to
create the named mutex for rolling, the NETWORK SERVICE process is unable to open it and receives an access
denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if the
NETWORK SERVICE process creates the mutex, the SYSTEM process is able to open it.

{noformat}
System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()
{noformat}
<call stack truncated>

was (Author: blake.raymond):
We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as SYSTEM and the other is IIS running as NETWORK SERVICE, with default
permissions for those users on Windows Server 2012. We are finding that if the SYSTEM process is the one to
create the named mutex for rolling, the NETWORK SERVICE process is unable to open it and receives an access
denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if the
NETWORK SERVICE process creates the mutex, the SYSTEM process is able to open it.

{{System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()}}
<call stack truncated>

> RollingFileAppender cannot be used by multiple process
> ------------------------------------------------------
>
>                 Key: LOG4NET-485
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-485
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13, 1.2.14, 1.3.0
>            Reporter: NN
>            Assignee: Dominik Psenner
>             Fix For: 1.2.14
>
>
> RollingFileAppender doesn't acquire lock when rolling takes place.
> As a consequence running multiple instances of the same program rewrites the same log file instead of
making a roll for everyone.
> There is FileAppender.InterProcessLock but it only protects writes and not rolls.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Blake Raymond (JIRA | 10 May 23:40 2016
Picon

[jira] [Comment Edited] (LOG4NET-485) RollingFileAppender cannot be used by multiple process


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

Blake Raymond edited comment on LOG4NET-485 at 5/10/16 9:39 PM:
----------------------------------------------------------------

We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as SYSTEM and the other is IIS running as NETWORK SERVICE, with default
permissions for those users on Windows Server 2012. We are finding that if the SYSTEM process is the one to
create the named mutex for rolling, the NETWORK SERVICE process is unable to open it and receives an access
denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if the
NETWORK SERVICE process creates the mutex, the SYSTEM process is able to open it.

{{System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()}}
<call stack truncated>

was (Author: blake.raymond):
We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as SYSTEM and the other is IIS running as NETWORK SERVICE, with default
permissions for those users on Windows Server 2012. We are finding that if the SYSTEM process is the one to
create the named mutex for rolling, the NETWORK SERVICE process is unable to open it and receives an access
denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if the
NETWORK SERVICE process creates the mutex, the SYSTEM process is able to open it.

System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()
<call stack truncated>

> RollingFileAppender cannot be used by multiple process
> ------------------------------------------------------
>
>                 Key: LOG4NET-485
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-485
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13, 1.2.14, 1.3.0
>            Reporter: NN
>            Assignee: Dominik Psenner
>             Fix For: 1.2.14
>
>
> RollingFileAppender doesn't acquire lock when rolling takes place.
> As a consequence running multiple instances of the same program rewrites the same log file instead of
making a roll for everyone.
> There is FileAppender.InterProcessLock but it only protects writes and not rolls.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Blake Raymond (JIRA | 10 May 23:39 2016
Picon

[jira] [Commented] (LOG4NET-485) RollingFileAppender cannot be used by multiple process


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

Blake Raymond commented on LOG4NET-485:
---------------------------------------

We have two processes sharing a log file using RollingFileAppender running under different users. One is a
Windows service running as SYSTEM and the other is IIS running as NETWORK SERVICE, with default
permissions for those users on Windows Server 2012. We are finding that if the SYSTEM process is the one to
create the named mutex for rolling, the NETWORK SERVICE process is unable to open it and receives an access
denied error during ActivateOptions for the RollingFileAppender. The reverse order works - if the
NETWORK SERVICE process creates the mutex, the SYSTEM process is able to open it.

System.UnauthorizedAccessException: Access to the path
'C__ProgramData_*********************.log' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
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, Boolean& createdNew)
   at log4net.Appender.RollingFileAppender.ActivateOptions()
<call stack truncated>

> RollingFileAppender cannot be used by multiple process
> ------------------------------------------------------
>
>                 Key: LOG4NET-485
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-485
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13, 1.2.14, 1.3.0
>            Reporter: NN
>            Assignee: Dominik Psenner
>             Fix For: 1.2.14
>
>
> RollingFileAppender doesn't acquire lock when rolling takes place.
> As a consequence running multiple instances of the same program rewrites the same log file instead of
making a roll for everyone.
> There is FileAppender.InterProcessLock but it only protects writes and not rolls.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Christoph Herzog (JIRA | 28 Apr 11:55 2016
Picon

[jira] [Commented] (LOG4NET-485) RollingFileAppender cannot be used by multiple process


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

Christoph Herzog commented on LOG4NET-485:
------------------------------------------

Tested with 1.2.15, definitly not fixed.

The whole part which is reponsible for rolling/creating of files needs to be garded by locks!

Worst case, when logging from multiple processes, is that the call to Log is stuck
{quote}
	mscorlib.dll!System.Threading.WaitHandle.WaitOne()	Unknown
 	log4net.dll!log4net.Appender.RollingFileAppender.AdjustFileBeforeAppend()	Unknown
 	log4net.dll!log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent loggingEvent)	Unknown
 	log4net.dll!log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent loggingEvent)	Unknown

	log4net.dll!log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent loggingEvent)	Unknown
 	log4net.dll!log4net.Repository.Hierarchy.Logger.CallAppenders(log4net.Core.LoggingEvent loggingEvent)	Unknown
 	log4net.dll!log4net.Repository.Hierarchy.Logger.ForcedLog(System.Type
callerStackBoundaryDeclaringType, log4net.Core.Level level, object message, System.Exception exception)	Unknown
 	log4net.dll!log4net.Repository.Hierarchy.Logger.Log(System.Type
callerStackBoundaryDeclaringType, log4net.Core.Level level, object message, System.Exception exception)	Unknown
 	log4net.dll!log4net.Core.LogImpl.WarnFormat(string format, object arg0, object arg1, object arg2)	Unknown
{quote}

The normal logging, will also generate errors, in this case the file is not rolled, but instead the logfile
is rewritten
{quote}
log4net:ERROR RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile
[C:\Temp\log\myLog.txt] already exists.
log4net:WARN Cannot RollFile [C:\Temp\log\myLog.1.txt] -> [C:\Temp\log\myLog.2.txt]. Source does
not exist
log4net:ERROR RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile
[C:\Temp\log\myLog.txt] already exists.
log4net:WARN Cannot RollFile [C:\Temp\log\myLog.2.txt] -> [C:\Temp\log\myLog.3.txt]. Source does
not exist
log4net:WARN Cannot RollFile [C:\Temp\log\myLog.1.txt] -> [C:\Temp\log\myLog.2.txt]. Source does
not exist
log4net:ERROR RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile
[C:\Temp\log\myLog.txt] already exists.
{quote}

> RollingFileAppender cannot be used by multiple process
> ------------------------------------------------------
>
>                 Key: LOG4NET-485
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-485
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13, 1.2.14, 1.3.0
>            Reporter: NN
>            Assignee: Dominik Psenner
>             Fix For: 1.2.14
>
>
> RollingFileAppender doesn't acquire lock when rolling takes place.
> As a consequence running multiple instances of the same program rewrites the same log file instead of
making a roll for everyone.
> There is FileAppender.InterProcessLock but it only protects writes and not rolls.

--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Gmane