Skip to content

Local IP Address Layout Renderer

Rolf Kristensen edited this page Jul 2, 2025 · 5 revisions

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

Platforms Supported: All - Requires nuget-package NLog.Targets.Network since NLog v6

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