Problem with AsyncWrapper (ignored?) vs shorhand async=true

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with AsyncWrapper (ignored?) vs shorhand async=true

sherpa
I run into performance issue with AsyncWrapper. When I wrap my file target into it I don't get any speed improvement. But when I use the shorthand notation <targets async="true">, it is working as expected.

According to doc, the async=true is just a shorthand so why the different behavior? Am I missing something or is it a bug?

The issue is same as reported here: http://stackoverflow.com/questions/3868240/nlog-performance
But the guy there seems to be happy with using the shorthand notation. I planned to initialize logging solely from code and don't see way to use shorthand notation there... and it also puzzles me.

Non-working example:
<targets>
  <target name="asyncFile" xsi:type="AsyncWrapper">
     <target name="file" xsi:type="File" fileName="${basedir}/log.txt" />
  </target>
</targets>

Working example:
<targets async="true"> 
  <target name="file" xsi:type="File" fileName="${basedir}/log.txt" />
</targets>


My version: NLog-Build-2.0.0.2005-4-g135261d
Reply | Threaded
Open this post in threaded view
|

Re: Problem with AsyncWrapper (ignored?) vs shorhand async=true

jfish222
Hi Sherpa,

I'm new to NLog (only a few days in) and am curious to know if you've found a solution.
Did your programmatic initialization exhibit the same speed issues as the long hand notation?

Please post any observations or solutions you may come across as I would be very interested in hearing your results.