I cannot find an example of how to modify my configuration file so that I can output a string passed to the context of the nested diagnostics.
Here is the C # code:
using (NLog.NestedDiagnosticsContext.Push(DateTime.Now.Ticks.ToString())) {
and this is the nLog entry in the web.config file (don't know how to change this):
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <targets> <target name="logfile" xsi:type="File" fileName="somepath\\logfile.txt" /> </targets> <rules> <logger name="*" minlevel="Debug" writeTo="logfile" /> </rules> </nlog>
source share