I am using log4net for logging in my windows service, it is working fine on XP, 7, 8, Windows Server 2003.
But when it comes to Windows 2012 server (also contains SQL server 2012 in it) log4net is not logging/updating the logs.
Log file is not updating after performing some operations in windows service. It needs restart of windows service to update the logs. Last/recent logs can be seen only after service restart.
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\MyLog_" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd.lo\g" />
<maxSizeRollBackups value="6" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<!--<conversionPattern value="%date %level %logger - %message%newline%exception"/>-->
<param name="ConversionPattern" value="%date %-5level %-60logger - %-10message%newline%exception" />
</layout>
</appender>
<appender name="SnFApp" type="log4net.Appender.RollingFileAppender">
<file value="Log\MyLog1_" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd.lo\g" />
<maxSizeRollBackups value="6" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<!--<conversionPattern value="%date %level %logger - %message%newline%exception"/>-->
<param name="ConversionPattern" value="%date %-5level %-60logger - %-10message%newline%exception" />
</layout>
</appender>
<logger name="TransactionManager.SaFManager.ClCCTaMPOSSaFManager">
<appender-ref ref="SnFApp" />
</logger>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingFileAppender" />
</root>
<logger name="Log4NetTest.OtherClass">
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
</logger>