<?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"
      throwConfigExceptions="true">
    <targets>
        <target xsi:type="File"
                name="ErrorToSingleFile"
                fileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/UI/Error.log"
                layout="${longdate} | ${pad:padding=-2:inner=${threadid}} | ${logger:shortName=true} | ${message}${newline}${exception:format=toString,Data}${newline}"
                archiveFileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/Archive/UI/Error-{#}.zip"
                archiveEvery="Day"
                archiveNumbering="Date"
                archiveDateFormat="yyyy-MM-dd"
                maxArchiveFiles="30"
                enableArchiveFileCompression="true" />
        <target xsi:type="File"
                name="AllEventsToSingleFile"
                fileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/UI/AllEvents.log"
                layout="${longdate} | ${pad:padding=-2:inner=${threadid}} | ${pad:padding=-5:inner=${level:uppercase=true}} | ${pad:padding=-20:fixedLength=True:inner=${logger:shortName=true}} | ${message}${onexception: [${exception:format=Message}]}"
                archiveFileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/Archive/UI/AllEvents-{#}.zip"
                archiveEvery="Day"
                archiveNumbering="Date"
                archiveDateFormat="yyyy-MM-dd"
                maxArchiveFiles="30"
                enableArchiveFileCompression="true" />
        <target xsi:type="File"
                name="SingleToFile"
                fileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/UI/${logger:shortName=true}.log"
                layout="${longdate} | ${pad:padding=-2:inner=${threadid}} | ${pad:padding=-5:inner=${level:uppercase=true}} | ${message}${onexception: [${exception:format=Message}]}"
                archiveFileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/Archive/UI/${logger:shortName=true}-{#}.zip"
                archiveEvery="Day"
                archiveNumbering="Date"
                archiveDateFormat="yyyy-MM-dd"
                maxArchiveFiles="30"
                enableArchiveFileCompression="true" />
        <target xsi:type="File"
                name="SingleToConcurrentFile"
                concurrentWrites="false"
                keepFileOpen="false"
                fileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/Plugin/${logger:shortName=true}.log"
                layout="${longdate} | ${pad:padding=-2:inner=${threadid}} | ${pad:padding=-5:inner=${level:uppercase=true}} | ${message}"
                archiveFileName="${specialfolder:folder=ApplicationData}/iiko/CashServer/Logs/POS/Archive/Plugin/${logger:shortName=true}-{#}.zip"
                archiveEvery="Day"
                archiveNumbering="Date"
                archiveDateFormat="yyyy-MM-dd"
                maxArchiveFiles="30"
                enableArchiveFileCompression="true" />
    </targets>
    <rules>
        <logger name="*" minlevel="Info" writeTo="AllEventsToSingleFile" />
        <logger name="*" minlevel="Error" writeTo="ErrorToSingleFile" />
        <logger name="*.UIControllerComponent" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="*.ViewComponentUserActions" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="*.ViewActionComponent" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="*.ViewComponentBuffer" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="*.PerformanceActionLoggerWrapper" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="*.MailBoxFactory" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="TraceListener" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="Performance" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="PerformanceTable" minlevel="Trace" writeTo="SingleToFile" />
        <logger name="LightningFront" minlevel="Trace" writeTo="SingleToFile" />

    </rules>
</nlog>