Skip to content

Commit 7fe3bc3

Browse files
Update nlog.md for Alternate NLog Configuration (From Nuget Package Website)
https://www.nuget.org/packages/Elastic.Apm.NLog
1 parent c0b4f71 commit 7fe3bc3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/reference/nlog.md

+19
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,22 @@ In order to use them, you need to add the [Elastic.Apm.NLog](https://www.nuget.o
3030

3131
As you can see in the sample file above, you can reference the current transaction id with `${ElasticApmTransactionId}` and the trace id with `${ElasticApmTraceId}`.
3232

33+
## Alternate [alternate]
34+
35+
Rather than using a Layout Renderer such as `jsonlayout`, you may specify the Trace and Transaction ID in the Target Layout:
36+
37+
```xml
38+
<nlog>
39+
<extensions>
40+
<add assembly="Elastic.Apm.NLog"/>
41+
</extensions>
42+
<targets>
43+
<target name="console"
44+
type="console"
45+
layout="${ElasticApmTraceId}|${ElasticApmTransactionId}|${ElasticApmSpanId}|${message}" />
46+
</targets>
47+
<rules>
48+
<logger name="*" minLevel="Debug" writeTo="Console" />
49+
</rules>
50+
</nlog>
51+
```

0 commit comments

Comments
 (0)