-
Notifications
You must be signed in to change notification settings - Fork 0
Cached Layout Renderer
Julian Verdurmen edited this page Sep 18, 2016
·
6 revisions
Applies caching to another layout output.
Supported in .NET, Silverlight, Compact Framework and Mono.
##Configuration Syntax
${cached:cached=Boolean:clearCache=ClearCacheOption:inner=Layout:cacheKey=Layout}
or by using ambient property to modify output of other layout renderer:
${other:cached=Boolean}
##Parameters ###Caching Options
- cached - Indicates whether this CachedLayoutRendererWrapper is enabled. Boolean Default: True
-
clearCache - Introduced in NLog 4.2. Indicates when the cache is cleared. Possible options:
None, OnInit, Onclose
. ClearCacheOption Default:OnInit, OnClose
. -
cacheKey - the layout to be checked if the cache is still valid. For example, the current day. Default
null
. Introduced in NLog 4.3.9
###Transformation Options
- inner - Wrapped layout. Layout
##Examples
-
${cached:cached=true:clearCache=OnInit,OnClose:inner=l}
: The value ofl
is cached and the cache will be cleared when the layout renderer is initialized or when it is closed. This is the same as${cached:cached=true:inner=l}
. -
${cached:cached=true:clearCache=None:inner=l}
: The value ofl
is cached and the cache will not be cleared.
##Remarks The value of the inner layout will be rendered only once and reused subsequently.
- Search in documentation
- Getting started
- Examples
- External articles and tutorials
- FAQ
- Platform support
- Advanced Configuration file options
- Filtering log messages
- [Using Time Sources](Time Source)
- Visual Studio support
- Who is using NLog
- [Write custom extensions](Extending NLog)