Skip to content

Commit

Permalink
Add support of log4net
Browse files Browse the repository at this point in the history
  • Loading branch information
ernitingarg committed Oct 10, 2022
1 parent 0f02db6 commit aa49608
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 1 deletion.
1 change: 1 addition & 0 deletions Uniswap.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]
10 changes: 9 additions & 1 deletion Uniswap.Client/Uniswap.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
<Reference Include="GraphQL.Primitives, Version=4.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\GraphQL.Primitives.4.0.2\lib\netstandard2.0\GraphQL.Primitives.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -104,7 +107,12 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="app.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
36 changes: 36 additions & 0 deletions Uniswap.Client/log4net.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
<appender name="console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %logger - %message%newline" />
</layout>
</appender>
<appender name="file" type="log4net.Appender.RollingFileAppender">
<!--Filename prefix with relative or absolute path-->
<file value=".\Logs\Log" />
<!--Append to the file i.e no overwritten-->
<appendToFile value="true" />
<!--Composite, support for both RollingStyle.Date & RollingStyle.Size-->
<rollingStyle value="Composite" />
<!--Always roll once per day-->
<datePattern value="'_'yyyyMMdd'.log'" />
<!--Also roll if size exceeds max size-->
<maximumFileSize value="300MB"/>
<!--Infinite backups i.e no deletion-->
<maxSizeRollBackups value="-1"/>
<!--Positive count direction, eg: log.1 is the first backup, log.5 is the most recent-->
<CountDirection value="1"/>
<!--Preserve filename extension-->
<preserveLogFileNameExtension value="true" />
<!--True if file name is static-->
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
<threshold value="INFO" />
</appender>
</log4net>
1 change: 1 addition & 0 deletions Uniswap.Client/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<package id="GraphQL.Client.Abstractions.Websocket" version="4.0.2" targetFramework="net461" />
<package id="GraphQL.Client.Serializer.SystemTextJson" version="4.0.2" targetFramework="net461" />
<package id="GraphQL.Primitives" version="4.0.2" targetFramework="net461" />
<package id="log4net" version="2.0.14" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
Expand Down
4 changes: 4 additions & 0 deletions Uniswap.GraphQL/Uniswap.GraphQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<HintPath>..\packages\GraphQL.Primitives.4.0.2\lib\netstandard2.0\GraphQL.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -124,6 +127,7 @@
<Compile Include="Uniswap.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
1 change: 1 addition & 0 deletions Uniswap.GraphQL/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<package id="GraphQL.Client.Abstractions.Websocket" version="4.0.2" targetFramework="net461" />
<package id="GraphQL.Client.Serializer.SystemTextJson" version="4.0.2" targetFramework="net461" />
<package id="GraphQL.Primitives" version="4.0.2" targetFramework="net461" />
<package id="log4net" version="2.0.14" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
Expand Down

0 comments on commit aa49608

Please sign in to comment.