Is there a way in the XML output of NLog to also specify the XML header/initialisator (<?xml version="1.0" encoding="utf-8" ?>)? Or is that not possible?
Like this:
<?xml version="1.0" encoding="utf-8" ?>
<logevent time="2019-09-11 11:28:42.5461" level="ERROR"><message>zebgevv</message><location class-name="MyClass"/></logevent>
<logevent time="2019-09-11 11:36:22.6371" level="ERROR"><message>shshsdfbvsd</message><location class-name="MyClass"/></logevent>
<logevent time="2019-09-11 11:41:17.0781" level="ERROR"><message>dshfsghs</message><location class-name="MyClass"/></logevent>
Hi! Thanks for opening your first issue here! Please make sure to follow the issue template - so we could help you better!
If you are using the File-Target. Then you can configure a Header-Layout:
<target name="myXml" xsi:type="File"
fileName="myXmlFile.txt"
encoding="utf-8"
header="<?xml version="1.0" encoding="utf-8" ?>" />
Thanks that worked :)
Most helpful comment
Thanks that worked :)