Compress log files

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

Compress log files

SystemCoder
I am using NLog in one of my projects and I am trying to have the output of the files to be compress.
I tried to use the compress file attribute, but when I look at the files, they are not compressed.
Could you please tell me what I might be doing wrong?
This is my config:
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

         
          <targets>
               
                <target name="file" xsi:type="File" fileName="C:\Workspaces\log.xml"
                                      layout="${message}" keepFileOpen="true"
             archiveFileName = "C:\Workspaces\archived\log.{#####}.xml"
              archiveAboveSize = "1048576" archiveNumbering = "Sequence"
                          fileAttributes="Compressed"
              concurrentWrites =  "true"/>
          </targets>

          <rules>
               
                <logger name ="*" minlevel="Debug" writeTo="file" />
        </rules>
  </nlog>
Loading...