Skip to content
Rolf Kristensen edited this page Jul 2, 2025 · 2 revisions

Writes LogEvents to file using GZip compression, by extending the standard NLog File Target.

Platforms Supported: All - Requires nuget-package NLog.Targets.GZipFile

Configuration Syntax

<targets>
  <target xsi:type="GZipFile"
          name="string"
          fileName="Layout"
          layout="Layout"
          compressionLevel="CompressionLevel"
          keepFileOpen="boolean"
          enableArchiveFileCompression="boolean"
          archiveOldFileOnStartup="boolean"
  />
</targets>

Parameters

  • fileName - Name of the file to write to. Layout Required.
  • layout - Text to be rendered. Layout Required.

    Default: ${longdate}|${level:uppercase=true}|${logger}|${message:withexception=true}

  • compressionLevel - File compression level
    • Optimal - Optimize for small file size
    • Fastest - Optimize for speed
    • NoCompression - Disables GZip compression
  • keepFileOpen - Disables GZip compression when configured to false. Default: true
  • archiveOldFileOnStartup - Disables GZip compression when configured to false. Default: true

Also inherits all parameters from the standard File-Target.

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy