<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
      <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
      <section name="settings" type="SyncTrayzor.Services.Config.XmlConfigurationSection, SyncTrayzor" />
    </configSections>
  
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    </startup>

    <system.net>
        <defaultProxy enabled="false" useDefaultCredentials="false" />
    </system.net>

    <settings>
      <UpdateApiUrl>https://synctrayzor.antonymale.co.uk/version-check</UpdateApiUrl>
      <HomepageUrl>https://github.com/canton7/SyncTrayzor</HomepageUrl>
      <DirectoryWatcherBackoffMilliseconds>2000</DirectoryWatcherBackoffMilliseconds>
      <DirectoryWatcherFolderExistenceCheckMilliseconds>3000</DirectoryWatcherFolderExistenceCheckMilliseconds>
      <IssuesUrl>https://github.com/canton7/SyncTrayzor/issues</IssuesUrl>
      <EnableAutostartOnFirstStart>false</EnableAutostartOnFirstStart>
      <CefRemoteDebuggingPort>2004</CefRemoteDebuggingPort>
      <Variant>Portable</Variant>
      <SyncthingConnectTimeoutSeconds>600</SyncthingConnectTimeoutSeconds>
      <EnforceSingleProcessPerUser>true</EnforceSingleProcessPerUser>
      <PathConfiguration>
        <LogFilePath>logs</LogFilePath>
        <ConfigurationFilePath>data\config.xml</ConfigurationFilePath>
        <ConfigurationFileBackupPath>data\config-backups</ConfigurationFileBackupPath>
        <CefCachePath>data\cef\cache</CefCachePath>
        <SyncthingPath>data\syncthing.exe</SyncthingPath>
        <SyncthingHomePath>data\syncthing</SyncthingHomePath>
      </PathConfiguration>
      <DefaultUserConfiguration Version="10">
        <ShowTrayIconOnlyOnClose>false</ShowTrayIconOnlyOnClose>
        <MinimizeToTray>false</MinimizeToTray>
        <CloseToTray>true</CloseToTray>
        <ShowDeviceConnectivityBalloons>false</ShowDeviceConnectivityBalloons>
        <ShowSynchronizedBalloonEvenIfNothingDownloaded>false</ShowSynchronizedBalloonEvenIfNothingDownloaded>
        <SyncthingAddress>localhost:8384</SyncthingAddress>
        <StartSyncthingAutomatically>true</StartSyncthingAutomatically>
        <SyncthingCommandLineFlags />
        <SyncthingEnvironmentalVariables />
        <SyncthingDenyUpgrade>false</SyncthingDenyUpgrade>
        <SyncthingPriorityLevel>Normal</SyncthingPriorityLevel>
        <Folders />
        <NotifyOfNewVersions>true</NotifyOfNewVersions>
        <ObfuscateDeviceIDs>true</ObfuscateDeviceIDs>
        <UseComputerCulture>true</UseComputerCulture>
        <SyncthingConsoleHeight>100</SyncthingConsoleHeight>
        <SyncthingWebBrowserZoomLevel>0</SyncthingWebBrowserZoomLevel>
        <LastSeenInstallCount>0</LastSeenInstallCount>
        <SyncthingCustomPath />
        <SyncthingCustomHomePath />
        <DisableHardwareRendering>false</DisableHardwareRendering>
        <EnableFailedTransferAlerts>true</EnableFailedTransferAlerts>
        <EnableConflictFileMonitoring>true</EnableConflictFileMonitoring>
        <SyncthingDebugFacilities />
        <ConflictResolverDeletesToRecycleBin>true</ConflictResolverDeletesToRecycleBin>
        <PauseDevicesOnMeteredNetworks>true</PauseDevicesOnMeteredNetworks>
        <HaveDonated>false</HaveDonated>
        <IconAnimationMode>DataTransferring</IconAnimationMode>
        <OpenFolderCommand>explorer.exe "{0}"</OpenFolderCommand>
        <ShowFileInFolderCommand>explorer.exe /select, "{0}"</ShowFileInFolderCommand>
      </DefaultUserConfiguration>
    </settings>

    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <targets>
        <target name="logfile" type="File" fileName="${gdc:item=LogFilePath}\SyncTrayzor.log" createDirs="True" archiveFileName="${gdc:item=LogFilePath}\logs archive\SyncTrayzor.{#}.log" archiveAboveSize="52428800" archiveEvery="Day" archiveNumbering="Sequence" maxArchiveFiles="3" autoFlush="True" layout="${longdate} #${processid} [${level}] ${logger}: ${message} ${exception:format=type,message,method,stacktrace,tostring:maxInnerExceptionLevel=10:innerFormat=shortType,message,method}" />
        <target name="syncthinglogfile" type="file" fileName="${gdc:item=LogFilePath}\syncthing.log" createDirs="True" archiveFileName="${gdc:item=LogFilePath}\logs archive\syncthing.{#}.log" archiveAboveSize="52428800" archiveEvery="Day" archiveNumbering="Sequence" maxArchiveFiles="3" layout="${message}" />
        <target name="downloadlogfile" type="file" fileName="${gdc:item=LogFilePath}\DownloadLog.csv" createDirs="True" archiveFileName="${gdc:item=LogFilePath}\logs archive\DownloadLog.{#}.csv" archiveAboveSize="52428800" archiveEvery="Day" archiveNumbering="Sequence" maxArchiveFiles="3">
          <layout xsi:type="LayoutWithHeaderAndFooter">
            <header xsi:type="SimpleLayout" text="Date,Folder,Path,Type,Action,Error" />
            <layout xsi:type="SimpleLayout" text="${longdate},${message}" />
          </layout>
        </target>
        <target name="debugger" type="Debugger" layout="${time} [${level}] ${logger:shortName=true} ${message}" />
      </targets>
      <rules>
        <!-- We want Syncthing output to go to the dedicated log file, and nowhere else -->
        <logger name="Syncthing" minlevel="Debug" writeTo="syncthinglogfile" final="true" />
        <logger name="DownloadLog" minlevel="Debug" writeTo="downloadlogfile" final="true" />
        
        <logger name="*" minlevel="Debug" writeTo="debugger" />
        <logger name="*" minlevel="Debug" writeTo="logfile" />
      </rules>
    </nlog>
</configuration>
