Skip to content

Commit

Permalink
Merge pull request #8 from CloudPhoenix/feature/release-1.6
Browse files Browse the repository at this point in the history
Release 1.6.0
  • Loading branch information
dedo1911 authored Jul 11, 2024
2 parents 4ddc0fa + 15fd04d commit ae9ca21
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 36 deletions.
4 changes: 1 addition & 3 deletions IServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public static IServiceCollection AddLogFlake(this IServiceCollection services, I

services.AddHttpClient(HttpClientConstants.ClientName, ConfigureClient);

services.AddScoped<ICorrelationService, CorrelationService>();

services.AddSingleton<ILogFlake, LogFlake>();
services.AddSingleton<ILogFlakeService, LogFlakeService>();

Expand All @@ -27,6 +25,6 @@ public static void ConfigureClient(HttpClient client)
{
client.Timeout = TimeSpan.FromSeconds(HttpClientConstants.PostTimeoutSeconds);
client.DefaultRequestHeaders.Add("Accept", "application/json");
client.DefaultRequestHeaders.Add("User-Agent", "logflake-client-netstandard/1.5.7");
client.DefaultRequestHeaders.Add("User-Agent", "logflake-client-netstandard/1.6.0");
}
}
1 change: 1 addition & 0 deletions LogFlake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public LogFlake(IOptions<LogFlakeOptions> logFlakeOptions, IHttpClientFactory ht
_httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
}

[Obsolete("Do not use this constructor, if you cannot instantiate with Dependency Injection, use the .NET Framework package.", error: true)]
public LogFlake(LogFlakeOptions logFlakeOptions, IHttpClientFactory httpClientFactory)
{
AppId = logFlakeOptions.AppId!;
Expand Down
5 changes: 2 additions & 3 deletions LogFlake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>LogFlake.Client.NetStandard</PackageId>
<Version>1.5.7</Version>
<Version>1.6.0</Version>
<Authors>CloudPhoenix Srl</Authors>
<Company>CloudPhoenix Srl</Company>
<TargetFramework>netstandard2.0</TargetFramework>
Expand All @@ -28,8 +28,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Snappier" Version="1.1.6" />
</ItemGroup>
</Project>
21 changes: 11 additions & 10 deletions Models/LogObject.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
using Newtonsoft.Json;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace NLogFlake.Models;

internal class LogObject
{
[JsonProperty("datetime")]
[JsonPropertyName("datetime")]
public DateTime Date = DateTime.UtcNow;

[JsonProperty("hostname")]
[JsonPropertyName("hostname")]
public string? Hostname { get; set; }

[JsonProperty("level")]
[JsonPropertyName("level")]
public LogLevels Level { get; set; }

[JsonProperty("content")]
[JsonPropertyName("content")]
public string? Content { get; set; }

[JsonProperty("correlation")]
[JsonPropertyName("correlation")]
public string? Correlation { get; set; }

[JsonProperty("params")]
[JsonPropertyName("params")]
public Dictionary<string, object>? Parameters { get; set; }

[JsonProperty("label")]
[JsonPropertyName("label")]
public string? Label { get; set; }

[JsonProperty("duration")]
[JsonPropertyName("duration")]
public long Duration { get; set; }

public override string ToString() => JsonConvert.SerializeObject(this);
public override string ToString() => JsonSerializer.Serialize(this);
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogFlake Client .NET Standard ![Version](https://img.shields.io/badge/version-1.5.5-blue.svg?cacheSeconds=2592000)
# LogFlake Client .NET Standard ![Version](https://img.shields.io/badge/version-1.6.0-blue.svg?cacheSeconds=2592000)

> This repository contains the sources for the client-side components of the LogFlake product suite for applications logs and performance collection for .NET applications.
Expand Down
13 changes: 0 additions & 13 deletions Services/CorrelationService.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Services/ICorrelationService.cs

This file was deleted.

0 comments on commit ae9ca21

Please sign in to comment.