Click or drag to resize

TargetLayoutWithLock Property

Note: This API is now obsolete.

NLog Layout are by default threadsafe, so multiple threads can be rendering logevents at the same time. This ensure high concurrency with no lock-congestion for the application-threads, especially when using AsyncTargetWrapper or AsyncTaskTarget. But if using custom Layout or LayoutRenderer that are not threadsafe, then this option can enabled to protect against thread-concurrency-issues. Allowing one to update to NLog 5.0 without having to fix custom/external layout-dependencies.

Namespace:  NLog.Targets
Assembly:  NLog (in NLog.dll) Version: 5.2.0+eed5f76d158dbcaef9326f7a0e1c281adad171e8
Syntax
[ObsoleteAttribute("Temporary workaround for broken Layout Renderers that are not threadsafe. Marked obsolete on NLog 5.0")]
public bool LayoutWithLock { get; set; }

Property Value

Type: Boolean
See Also