-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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)
${file-contents:encoding=Encoding:fileName=Layout}
- encoding - Encoding used in the file.Encoding
- fileName - Name of the file.Layout
If the file content doesn't change, then adding the option :cached=true will give a performance boost.
- 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