Skip to content

Local IP Address Layout Renderer

Rolf Kristensen edited this page Jan 13, 2020 · 3 revisions

The local IP address whether IPv4 or IPv6 from NetworkInterface.GetAllNetworkInterfaces

Platforms Supported: Limited (Not supported on NetStandard1.3+1.5)

Introduced with NLog 4.6.8

Configuration Syntax

${local-ip:addressFamily=InterNetwork}

Parameters

  • AddressFamily - Explicitly prioritize IP addresses from a certain AddressFamily (Ex. InterNetwork / InterNetworkV6)

Improving Performance

The lookup of the active IP-address on the local machine has a performance hit. For better performance then it is recommended to use it with cachedSeconds like this:

${local-ip:cachedSeconds=60}
Clone this wiki locally