| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
NLog File Target extension that uses operating-system append semantics, allowing multiple processes to write concurrently to the same file.
AtomicFileTarget extends NLog's standard FileTarget and uses native operating-system file APIs to provide atomic append semantics:
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 AtomFile when loading from NLog.config-file, if having added extension to NLog.config-file:
<extensions>
<add assembly="NLog.Targets.AtomicFile"/>
</extensions>Alternative register from code using fluent configuration API:
LogManager.Setup().SetupExtensions(ext => {
ext.RegisterTarget<NLog.Targets.AtomicFileTarget>();
});<nlog>
<extensions>
<add assembly="NLog.Targets.AtomicFile"/>
</extensions>
<targets>
<target xsi:type="AtomFile"
name="logfile"
fileName="${basedir}/logs/application.log"
layout="${longdate}|${level:uppercase=true}|${message} ${exception:format=tostring}" />
</targets>
</nlog>| Back | FazBrowse Home | New Git URL |