FileTarget with support for writing GZip FileStream
$ dotnet add package NLog.Targets.GZipFileNLog File Target writing to file with GZip compression using GZipStream.
If having trouble with output, then check NLog InternalLogger for clues. See also Troubleshooting NLog
See the NLog Wiki for available options and examples.
NLog will only recognize type-alias GZipFile when loading from NLog.config-file, if having added extension to NLog.config-file:
<extensions>
<add assembly="NLog.Targets.GZipFile"/>
</extensions>
Alternative register from code using fluent configuration API:
LogManager.Setup().SetupExtensions(ext => {
ext.RegisterTarget<NLog.Targets.GZipFileTarget>();
});