Skip to content

FileContents layout renderer

Rolf Kristensen edited this page Jun 22, 2025 · 6 revisions

Renders contents of the specified file. Example if having a flat file containing a special setting value.

Platforms Supported: All (Removed with NLog v6 - Instead setup custom layout-renderer with method-delegate)

Configuration Syntax

${file-contents:encoding=Encoding:fileName=Layout}

Parameters

File Options

  • encoding - Encoding used in the file.Encoding
  • fileName - Name of the file.Layout

Notes

If the file content doesn't change, then adding the option :cached=true will give a performance boost.

Clone this wiki locally