<?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"
      autoReload="true">

	<!-- enable asp.net core layout renderers -->
	<extensions>
		<add assembly="Hideez.Enterprise.Tenant"/>
		<add assembly="Hideez.Foundation.Common"/>
		<add assembly="Hideez.Foundation.Components"/>
		<add assembly="Hideez.Foundation.Modules"/>
	</extensions>

	<!-- the targets to write to -->
	<targets>

		<!-- write to file  -->
		<target xsi:type="File" name="file" fileName="${basedir}/logs/app-${shortdate:universalTime=true}.log"
				   layout="app> ${longdate:universalTime=true}|${uppercase:${level}}|${callsite}|[${aspnet-request-host}] ${message} ${exception:format=tostring}"
				   maxArchiveFiles="35"
				   maxArchiveDays="35"
				   keepFileOpen="false"/>
		<!-- write to output console -->
		<target name="debugger" xsi:type="Debugger" layout="${longdate}|${level:uppercase=true}|${message}" />
		<target name="console" xsi:type="Console" layout="${longdate}|${level:uppercase=true}|${message}" />

	</targets>

	<!-- rules to map from logger name to target -->
	<rules>
		<logger name="Microsoft.*" maxlevel="Info" final="true" />
		<logger name="Microsoft.Hosting.Lifetime*" maxlevel="Info" final="true" />
		<logger name="System.Net.Http.*" maxlevel="Info" final="true" />
		<logger name="Quartz.*" maxlevel="Info" final="true" />
		<logger name="OpenIddict.*" maxlevel="Info" final="true" />
		<logger name="Finbuckle.*" maxlevel="Info" final="true" />
		<!-- write to file -->
		<logger name="*" minlevel="Info" writeTo="file" />
		<!-- write to output console -->
		<logger name="*" minlevel="Trace" writeTo="debugger, console" />
	</rules>
</nlog>