-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Windows Identity Layout Renderer
Rolf Kristensen edited this page Oct 15, 2023
·
18 revisions
Render Windows identity information (username) from the current thread-context.
Platforms Supported: Limited - Windows only and requires nuget-package NLog.WindowsIdentity with NLog 5.0
${windows-identity:userName=Boolean:domain=Boolean}
- userName - Indicates whether username should be included. Boolean Default: True
- domain - Indicates whether domain name should be included. Boolean Default: True
-
${environment-user} is an alternative that depends on Environment.UserName, which is compatible with both Windows/Linux (and less overhead).
-
${identity} is an alternative that depends on Thread.CurrentPrincipal.
-
${aspnet-user-identity} is an alternative that only works on ASP.NET Applications with identity enabled.
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
- Articles about NLog
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json