<?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"
	  internalLogFile="internal.log"
      internalLogLevel="Info">

	<!-- enable asp.net core layout renderers -->
	<extensions>
		<add assembly="NLog.Web.AspNetCore"/>
		<add assembly="LANCommander"/>
	</extensions>

	<!-- the targets to write to -->
	<targets>
		<!-- File Target for all log messages with basic details -->
		<target xsi:type="File" name="MainLogFile" fileName="${basedir}/Logs/log.txt" archiveEvery="Day" />
		<target xsi:type="File" name="GameServerLogFile" fileName="${basedir}/Logs/GameServers/${event-properties:ServerName}.log" archiveEvery="Day" />
		<target xsi:type="GameServerHub" name="GameServerHub" hubUrl="http://localhost:1337/hubs/gameserver" />
	</targets>

	<!-- rules to map from logger name to target -->
	<rules>
		<!--All logs, including from Microsoft-->
		<logger name="LANCommander.*" minlevel="Trace" writeTo="MainLogFile" />
		<logger name="LANCommander.Services.ServerProcessService" minlevel="Error" writeTo="GameServerLogFile,GameServerHub" />
	</rules>
</nlog>