Skip to content

Commit

Permalink
Merge pull request #1 from JosephWoodward/NetStandard13
Browse files Browse the repository at this point in the history
Added .NET Standard 1.3 support
  • Loading branch information
josephwoodward authored Jan 19, 2019
2 parents e0e7a75 + 424edae commit c22e9e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/Serilog.Sinks.Loki/LokiBatchFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ public void Format(IEnumerable<LogEvent> logEvents, ITextFormatter formatter, Te
};

if (logEvent.Exception != null)
{
#if NETSTANDARD2_0
e.Line += "\n\n" + logEvent.Exception.ToStringDemystified();
#else
e.Line += "\n\n" + logEvent.Exception.ToString();
#endif
}

var entry = JsonConvert.SerializeObject(e);

Expand Down
9 changes: 6 additions & 3 deletions src/Serilog.Sinks.Loki/Serilog.Sinks.Loki.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<VersionPrefix>1.0.0-beta3</VersionPrefix>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<VersionPrefix>1.0.0-beta4</VersionPrefix>
<AssemblyName>Serilog.Sinks.Loki</AssemblyName>
<PackageId>Serilog.Sinks.Loki</PackageId>
<PackageTags>loki,serilog,sinks</PackageTags>
Expand All @@ -16,10 +16,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Serilog" Version="2.7.2-dev-01033" />
<PackageReference Include="Serilog.Sinks.Http" Version="5.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Ben.Demystifier" Version="0.1.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace Serilog.Sinks.Loki.Tests.HttpClientTests
public class RequestUriTests
{
private readonly TestHttpClient _client;
private readonly NoAuthCredentials _credentials;

public RequestUriTests()
{
Expand Down

0 comments on commit c22e9e0

Please sign in to comment.