-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ScopeTiming Layout Renderer
Rolf Kristensen edited this page Feb 4, 2023
·
4 revisions
ScopeContext allows one to give a scope name for an operation that can be async. When the scope begins then it automatically captures a timestamp. This can be used to show duration of the active scope.
Platforms Supported: All
Introduced in NLog 5.0 and replaces ${ndlctiming}
See also NLog Context and ${scopeproperty} and ${scopenested}
${scopetiming:currentScope=Boolean:StartTime=Boolean:format=String}
-
currentScope - Whether to only include the duration of the last scope created.
Boolean
. DefaultFalse
. -
StartTime - Whether to just display the scope creation time, and not the duration.
Boolean
. DefaultFalse
-
format - TimeSpan format. Can be any argument accepted by
TimeSpan.ToString(format)
.string
. Defaultnull
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json