<?xml version="1.0" encoding="utf-8" ?>

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<variable name="appType" value="" />
	<variable name="appId" value="" />
	<targets>
		<target name="all" xsi:type="File"
			fileName="${basedir}/../Logs/Log.txt"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
	</targets>

	<targets>
		<target name="trace" xsi:type="File"
			openFileCacheTimeout="3600"
			ConcurrentWrites="false"
			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}/Trace/${shortdate}.log"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}" />
		<target name="traceConsole" type="ColoredConsole"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}" />
	</targets>
	
	<targets>
		<target name="debug" xsi:type="File"
			openFileCacheTimeout="3600"
			ConcurrentWrites="false"
			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}/Debug/${shortdate}.log"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
		<target name="debugConsole" type="ColoredConsole"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
	</targets>

	<targets>
		<target name="info" xsi:type="File"
			openFileCacheTimeout="3600"
			ConcurrentWrites="false"
			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}/Info/${shortdate}.log"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
		<target name="infoConsole" type="ColoredConsole"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
	</targets>
	
	<targets>
		<target name="error" xsi:type="File"
			openFileCacheTimeout="3600"
			ConcurrentWrites="false"
			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}/Error/${shortdate}.log"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}" />
		<target name="errorConsole" type="ColoredConsole"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}" />
	</targets>
  
  <targets>
		<target name="warn" xsi:type="File"
			openFileCacheTimeout="3600"
			ConcurrentWrites="false"
			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}/Warning/${shortdate}.log"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message}" />
		<target name="warnConsole" type="ColoredConsole"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message}" />
	</targets>
  
  <targets>
		<target name="fatal" xsi:type="File"
			openFileCacheTimeout="3600"
			ConcurrentWrites="false"
			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}/Fatal/${shortdate}.log"
			deleteOldFileOnStartup="false"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}" />
		<target name="fatalConsole" type="ColoredConsole"
			layout="${longdate} ${var:appTypeFormat} ${var:appIdFormat} ${message} ${newline} ${stacktrace:format=Raw:topFrames=10:skipFrames=0}" />
	</targets>
	
	<rules>
		<logger name="*" minlevel="Trace" writeTo="all" />
		<logger name="*" minlevel="Trace" maxlevel="Trace" writeTo="trace" />
		<logger name="*" minlevel="Trace" maxlevel="Trace" writeTo="traceConsole" />
		<logger name="*" minlevel="Debug" maxlevel="Debug" writeTo="debug" />
		<logger name="*" minlevel="Debug" maxlevel="Debug" writeTo="debugConsole" />
		<logger name="*" minlevel="Info" maxlevel="Info" writeTo="info" />
		<logger name="*" minlevel="Info" maxlevel="Info" writeTo="infoConsole" />
		<logger name="*" minlevel="Warn" maxlevel="Warn" writeTo="warn" />
		<logger name="*" minlevel="Warn" maxlevel="Warn" writeTo="warnConsole" />
		<logger name="*" minlevel="Error" maxlevel="Error" writeTo="error" />
		<logger name="*" minlevel="Error" maxlevel="Error" writeTo="errorConsole" />
		<logger name="*" minlevel="Fatal" maxlevel="Fatal" writeTo="fatal" />
		<logger name="*" minlevel="Fatal" maxlevel="Fatal" writeTo="fatalConsole" />
	</rules>
</nlog>