Sends log messages over the network using Tcp / Udp / Tls / Http / Https
Platforms Supported: All - Requires nuget-package NLog.Targets.Network since NLog v6
For SOAP-based webservice support over HTTP and HTTPS use WebService target.
<targets> <target xsi:type="Network" name="String" address="Layout" onOverflow="Enum" newLine="Boolean" lineEnding="CRLF|LF|CR|Null|None" layout="Layout" maxMessageSize="Integer" encoding="Encoding" connectionCacheSize="Integer" maxConnections="Integer" maxQueueSize="Integer" keepConnection="Boolean" onConnectionOverflow="Enum" keepAliveTimeSeconds="Integer" sslProtocols="Enum" /> </targets>
Read more about using the Configuration File.
layout - Layout used to format log messages. Layout Required. Default: ${longdate}|${level:uppercase=true}|${logger}|${message:withexception=true}
encoding - Encoding to be used. Encoding Default: utf-8
newLine - Indicates whether to append newline at the end of log message. Boolean Default: False
lineEnding - Line Ending to be used if newLine is set to true. LineEndingMode
Default: CRLF
. Not used if newLine is false
. Introduced in 4.3.8. Possible values:
compress - Use compression to reduce message size. Default: None
Introduced with NLog 5.0
compressMinBytes - Use compression only when message size is higher than limit to reduce overhead in cpu-usage and additional headers. Default: 0
Introduced with NLog 5.0
maxMessageSize - Maximum message size in bytes. Integer Default: 65000
Notice when using UDP and the message-size exceeds MTU-size (default 1500 bytes), then IP fragmentation will happen. If network-switch/router has DontFragment enabled, then it will drop large network packets. Usually UDP is only used on local network since no authentication or security, and the network-switch seldom has DontFragment enabled (or under your control to be configured).
onOverflow - Action that should be taken if the message-size is larger than maxMessageSize. Possible values:
address - Network address. Layout
The network address can be:
keepConnection - Indicates whether to keep connection open whenever possible. Not used for stateless protocols (= http, https) Boolean Default: True
connectionCacheSize - Size of the connection cache (number of connections which are kept alive). Integer Default: 5
maxConnections - Maximum current connections when keepConnection = false. 0 = no limit. Integer
Default: 100
(Before NLog 5.0 the default was 0)
Introduced in NLog 4.2.1
onConnectionOverflow - Action that should be taken when open connections are higher than limit maxConnections.
Introduced in NLog 4.2.1.
Possible enum values:
maxQueueSize - Maximum queue size for a single connection. 0 means no limit. Integer
. Default: 10000 (Before NLog 5.0 the default was 0)
NLog 4.6.7 enabled queue-support for http/https and NLog 4.7.1 activated this setting for http/https. NLog 5.0.0 enabled queue-support for UDP.
onQueueOverflow - Action that should be taken if pending queue of messages is larger than maxQueueSize.
Introduced with NLog 5.0
KeepAliveTimeSeconds - Idle time before first TCP keep-alive probe is sent. Faster detection of stale TCP connections. Currently only implemented for TCP. Integer
. Default: 0 (Disabled)
Introduced in NLog 4.6
SendTimeoutSeconds - Waiting time before TCP socket send-operation fails with timeout error. Default wait forever when network cable unplugged and tcp-buffer becomes full. Integer
. Default: 0 (Disabled)
Introduced in NLog 5.3.4
NoDelay - Disable the delayed ACK timer, and avoid delay of 200 ms. Default = true.
Introduced in NLog 5.5. Before NLog 6.0 it was default = false.
sslProtocols - Enables SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. Invalid certificates are not supported.
Introduced in NLog 4.6
Possible values (combination allowed, comma separated):
SslCertificateFile - Enables loading SSL certificate from local file, instead of injecting into operating system cache (Blank value means disable SSL certificate validation)
Introduced in NLog 6.0
SslCertificatePassword - When password is needed for loading SSL certificate from local file using SslCertificateFile
Introduced in NLog 6.0
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4