, , , : log4net NLog XML
.
, KallDrexx. NLog, ( ), NLogHelper, , :
public static XmlLoggingConfiguration SetNlogConfiguration()
{
var sr = new StringReader(NlogXmlConfigString1());
var xr = XmlReader.Create(sr);
var config = new XmlLoggingConfiguration(xr, null);
return config;
}
xml, :
private static string NlogXmlConfigString1()
{
return @"<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='${specialfolder:file=My_Logger.txt:folder=Desktop}' />
</targets>
<rules>
<logger name='*' minlevel='Info' writeTo='logfile' />
</rules>
</nlog>";
}
, :
NLog.LogManager.Configuration = NlogHelper.Helper.SetNlogConfiguration();
, , , , , . xml .
, , , .
, , NLog .