<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
  </startup>
  <log4net>
    <!-- A1 is set to be a ConsoleAppender -->
    <appender name="A1" type="log4net.Appender.ConsoleAppender">
      <!-- A1 uses PatternLayout -->
      <layout type="log4net.Layout.PatternLayout">
        <!--<conversionPattern value="%-8r %-5p [%t] %c - %m%n" />-->
        <conversionPattern value="%-5level %date{HH:mm:ss} %message%n" />
      </layout>
    </appender>
    <!-- root logger -->
    <root>
      <level value="ALL" />
      <!--<appender-ref ref="A1" />-->
      <!--<appender-ref ref="RollingFile" />-->
    </root>
    <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
      <file type="log4net.Util.PatternString" value="%envFolderPath{CommonApplicationData}\\Thermo\Xcalibur\\Logs\\Xcalibur.log" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="100" />
      <maximumFileSize value="10MB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <appender name="RollingFileTrayUi" type="log4net.Appender.RollingFileAppender">
      <file type="log4net.Util.PatternString" value="C:\\Users\\Public\\Documents\\Thermo_InstrumentAgent\\Logs\\icagent-%date{yyyyMMdd}.traylog" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="100" />
      <maximumFileSize value="10MB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="{'Timestamp':'%date','level':'%level','MessageTemplate':'%message'}%newline" />
      </layout>
    </appender>
    <!--Do not change the logger name-->
    <logger name="XcaliburLogger" additivity="False">
      <level value="ALL" />
      <appender-ref ref="RollingFile" />
    </logger>
    <!--Do not change the logger name-->
    <logger name="TrayUiLogger" additivity="False">
      <level value="ALL" />
      <appender-ref ref="RollingFileTrayUi" />
    </logger>
  </log4net>
  <appSettings>
    <!--For release build only, 0 (false) to show, 1 (true) to hide-->
    <!--ExternalProcessHost32 is always showed on debug build-->
    <add key="HideExternalProcessHost32" value="1" />
    <add key="PluginProcess.ShowConsole" value="False" />
    <add key="CefRemoteDebuggingPort" value="8089" />
    <add key="PluginProcess.ReadyTimeoutMs" value="5000" />
    <add key="ProcessServiceHostAddress" value="localhost:8099" />
    <add key="AcquireXHostAddress" value="webapps\app\acquireX\index.html" />
    <add key="GhCardHostAddress" value="webapps\app\acquireX\index.html?routeName=GhCardInitialization" />
    <add key="GhMethodSelectionHostAddress" value="webapps\app\acquireX\index.html?routeName=GhMethodSelection" />
    <!-- Fix for Bug 192535 
      The timeout in XCalService when waiting for Gateshead module info is 10s
      The default timeout in XCalibur start up initialization waiting for the GatesheadConfigurationResponse is also 10s
      In the case of the MSOnly case, the XCalibur side is timeout too soon, so we add the GhClinetTimeout config entry 
      and set the max wait to be 40s.
      As the Gateshead module is not included in 4.5, the GhClientTimeout would not affect the 4.5 XCalibur initialization
    -->
    <add key="GhClientTimeout" value="40000" />
    <add key="AlmanacHostAddress" value="thermo://almanac/index.html" />
    <add key="AcquireXMonitorHostAddress" value="webapps\app\experimentmonitor\index.html" />
    <add key="AcquireXMonitorNewHostAddress" value="webapps\app\acquireX\index.html?routeName=ExperimentMonitor" />
    <add key="XcalServiceUri" value="http://localhost:9011" />
    <!--<add key="ShowAcquireXSubmissionButton" value="true" />-->
    <!--<add key="AcquireXHostAddress" value="http://localhost:8080" />-->
    <add key="AcquireXAsynch" value="False" />
    <add key="AlmanacAsynch" value="True" />
    <add key="AcqxWFTemplate" value="Acqx.wfdt" />
    <add key="GatesheadInstalled" value="True" />
    <add key="GatesheadInstrumentsHelpPath" value="C:\ProgramData\Thermo\GatesheadManuals\Instruments" />
    <add key="GatesheadConsumablesHelpPath" value="C:\ProgramData\Thermo\GatesheadManuals\Consumables" />
    <add key="log4net.Internal.Debug" value="true" />
    <!--<add key="AcqxUseSiiSimulationMode" value="true"/>-->
    <!--<add key="EnableTunePageView" value="true"/>-->
    <!--SII needs a bit of time maybe less than a second to start smartup request to LC-->
    <add key="EquilibrateLcStartupDelay" value="2000" />
  </appSettings>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.8.0" newVersion="2.0.8.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.4.0.0" newVersion="3.4.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.diagnostics>
    <trace autoflush="true">
      <listeners>
        <add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\ProgramData\Thermo\Xcalibur\Logs\log4net.txt" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>