Skip to content

NLog/NLog.Targets.ConcurrentFile

Repository files navigation

NLog Concurrent File Target

Version AppVeyor

NLog File Target with support for ConcurrentWrites-option where multiple processes can write to the same file.

This is the legacy FileTarget from NLog v5, if unable to use the new optimized FileTarget included with NLog v6.

Notice one must explicit configure ConcurrentWrites="true" to support concurrent writing to same file. Alternative consider using the new NLog.Targets.AtomicFile nuget-package.

If having trouble with output, then check NLog InternalLogger for clues. See also Troubleshooting NLog

See the NLog Wiki for available options and examples.

Register Extension

NLog will only recognize type-alias File when loading from NLog.config-file, if having added extension to NLog.config-file:

<extensions>
    <add assembly="NLog.Targets.ConcurrentFile"/>
</extensions>

Alternative register from code using fluent configuration API:

LogManager.Setup().SetupExtensions(ext => {
   ext.RegisterTarget<NLog.Targets.ConcurrentFileTarget>();
});

About

Legacy NLog v5 FileTarget for writing logevents into file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages