You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rolf Kristensen edited this page Mar 26, 2026
·
6 revisions
A specialized layout that renders to W3C Extended Log Format (ELF)
Platforms Supported: All
Introduced with NLog.Web 5.0
<targetname="w3cFile"xsi:type="File"fileName="log-file.json" >
<layoutxsi:type="W3CExtendedLogLayout">
<directivename="Software"layout="My Web Server" /> <!-- Optional - Can be repeated -->
<fieldname="cs-method"layout="${aspnet-request-method}" /> <!-- Optional - Can be repeated -->
</layout>
</target>
Note default fields will be printed, when no fields has been specified. Same behavior for directives.
Parameters
field
name - Required. The name of the W3C Extended Field
layout - The layout value of the W3C Extended Field
directive
name - Required. The name of the W3C Extended Directive Header
layout - The layout value of the W3C Extended Directive Header