NLog WebService Target
April 19, 2026 ยท View on GitHub
NLog WebService Target for calling web-service for each logevent, with support for different protocols: JsonPost, XmlPost, HttpGet, HttpPost, Soap11, Soap12
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 WebService when loading from NLog.config-file, if having added extension to NLog.config-file:
<extensions>
<add assembly="NLog.Targets.WebService"/>
</extensions>
Alternative register from code using fluent configuration API:
LogManager.Setup().SetupExtensions(ext => {
ext.RegisterTarget<NLog.Targets.WebServiceTarget>();
});