Skip to content

Instantly share code, notes, and snippets.

@mikemichaelis
Created January 9, 2012 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemichaelis/1583437 to your computer and use it in GitHub Desktop.
Save mikemichaelis/1583437 to your computer and use it in GitHub Desktop.
NLog config to log output formatted to log4j XML (includes xml header and namespace)
<target xsi:type="File" name="file" fileName="file.xml">
<layout xsi:type="LayoutWithHeaderAndFooter">
<header xsi:type="SimpleLayout" text="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;&lt;root xmlns:log4j=&quot;http://jakarta.apache.org/log4j/&quot;&gt;"/>
<layout xsi:type="Log4JXmlEventLayout" />
<footer xsi:type="SimpleLayout" text="&lt;/root&gt;"/>
</layout>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment