Archiving writes multiple copies of the same file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Archiving writes multiple copies of the same file

t.whaley
We are currently using an configuration like this below:

 <targets async="false">
      <target name="file" xsi:type="File"    fileName="${basedir}/logs/${machinename}.active.log"
             header="-------------------- Logging started on ${longdate} --------------------"
             footer="-------------------- Logging finished on ${longdate} --------------------"
             archiveFileName="${basedir}/logs/${machinename}.archive.{#}.log"
             archiveAboveSize="1073741824" maxArchiveFiles="5" concurrentWrites="false" archiveEvery="Day"/>
      <target name="fileAsException" xsi:type="FilteringWrapper" condition="length('${exception}')&gt;0">
        <target name="f1" xsi:type="File" fileName="${basedir}/logs.${machinename}.active.log" layout="${ExceptionFileLayout}"
          archiveFileName="${basedir}/logs/${machinename}.archive.{#}.log"
          archiveAboveSize="1073741824" maxArchiveFiles="5" concurrentWrites="false" archiveEvery="Day"/>
      </target>
</targets>
    <rules>
      <logger name="CrystalEngineering.Factory.RunLog"  minlevel="Info" writeTo="sqlFile" final="true"/>
      <logger name="RunLogs" minlevel="Info" writeTo="RunLogs" final="true"/>
      <logger name="*" minlevel="Trace" writeTo="file,fileAsException"/>
    </rules>

Our Application
We have an multithreaded (and also multiple Task objects that use the thread pool) WPF service that writes to these targets.  We are attempting to archive when we reach 1GB and when the date rolls.  

The Problem
When the archive file is created we are getting two or three copies of the file in the archive folder.  They all have exactly the same byte count and same timestamp and have sequential names (archive.2.log and archive.3.log for example).  Why are we getting these duplicate files at archive time when we reach 1GB?

Thanks,
Tom
Loading...