Details
Description
1- Create a WCF service using VS2010 that do a basic operation "GetDate" that returns a string and also log this string into a text file using the below appender
<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="C:\testproj\TestLog_DEV__%property
__"/>
<dateKind value="utc"/>
<rollingStyle value="Composite"/>
<rollMinuteInterval value="5"/>
<datePattern value="yyyyMMdd\tHHmm00.lo\g"/>
<maxSizeRollBackups value="-1"/>
<maximumFileSize value="50KB"/>
<layout type="log4net.Layout.PatternLayout">
<header value="#Fields: date time c-ip s-ip cs(User-Agent) cs(Cookie) cs-uri-stem cs-uri-query
"></header>
<conversionPattern value="%utcdate
%utcdate
{HH:mm:ss} %message%newline" />
</layout>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
</appender>
<logger name="RollingLogFileAppender">
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</logger>
</log4net>
2- Create a new console application using VS 2012 and add a service reference to the wcf service, make sure to check the option "create asynchronous operation".
3- In a for loop call the the WCF method for 40,000 times asynchronously.
4- Check the log entries in the text files, you notice that the number of log entries are less than 40,000.