From f0693b919c66885cb3eca7b107976730c53c1c54 Mon Sep 17 00:00:00 2001 From: Adam Williams Date: Mon, 20 Nov 2023 13:08:56 +0000 Subject: [PATCH 1/2] Update to .NET 8 and Serilog v3 --- .github/workflows/workflow.yml | 8 +- .../Controllers/WeatherForecastController.cs | 6 +- src/Debugger/Debugger.csproj | 12 +-- src/Debugger/Program.cs | 88 +++++++------------ src/Debugger/Startup.cs | 50 ----------- .../Redbox.Serilog.Stackdriver.Tests.csproj | 2 +- .../Redbox.Serilog.Stackdriver.csproj | 4 +- 7 files changed, 52 insertions(+), 118 deletions(-) delete mode 100644 src/Debugger/Startup.cs diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 222c236..2c0a33e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,16 +4,16 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-16.04 + runs-on: ubuntu name: Build steps: # Checkout - uses: actions/checkout@master - # Setup dotnet 3 + # Setup dotnet 8 - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.301 + dotnet-version: 8.x # Build - run: dotnet test -c Release && dotnet build -c Release ################################################ @@ -47,4 +47,4 @@ jobs: Install instructions: `dotnet add package ${{ steps.pack_release.outputs.PACKAGE }} --version ${{ steps.get_version.outputs.VERSION }}` env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/Debugger/Controllers/WeatherForecastController.cs b/src/Debugger/Controllers/WeatherForecastController.cs index 22d8f92..969c63d 100644 --- a/src/Debugger/Controllers/WeatherForecastController.cs +++ b/src/Debugger/Controllers/WeatherForecastController.cs @@ -36,7 +36,11 @@ public IEnumerable Get() }) .ToArray(); - _logger.LogInformation($"Returning some weather!"); + var maxTemp = weather.Max(w => w.TemperatureC); + using (var scope = _logger.BeginScope("{MaximumTemperature}", maxTemp)) + { + _logger.LogInformation($"Returning some weather!"); + } return weather; } diff --git a/src/Debugger/Debugger.csproj b/src/Debugger/Debugger.csproj index 7f1e35f..2bb1253 100644 --- a/src/Debugger/Debugger.csproj +++ b/src/Debugger/Debugger.csproj @@ -1,17 +1,19 @@ - netcoreapp3.0 + net8.0 + enable + enable - - - - + + + + diff --git a/src/Debugger/Program.cs b/src/Debugger/Program.cs index 5f17f98..fa14d24 100644 --- a/src/Debugger/Program.cs +++ b/src/Debugger/Program.cs @@ -1,59 +1,37 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Serilog; -using Serilog.Events; -using Redbox.Serilog.Stackdriver; -namespace Debugger +var builder = WebApplication.CreateBuilder(args); + +Serilog.Debugging.SelfLog.Enable(Console.WriteLine); + +builder.Host.UseSerilog((context, services, configuration) => configuration + .ReadFrom.Configuration(context.Configuration) + .ReadFrom.Services(services) + .Enrich.FromLogContext() +); + +// Add services to the container. +builder.Services.AddControllersWithViews(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) { - public class Program - { - public static int Main(string[] args) - { - var configuration = new ConfigurationBuilder() - .AddJsonFile("appsettings.json") - .Build(); - - Log.Logger = new LoggerConfiguration() - .MinimumLevel.Debug() - .MinimumLevel.Override("Microsoft", LogEventLevel.Information) - .Enrich.FromLogContext() - .ReadFrom.Configuration(configuration) - .WriteTo.Console(new StackdriverJsonFormatter()) - .CreateLogger(); - - Log.Logger.Information("test"); - - try - { - Log.Information("Starting web host"); - CreateHostBuilder(args).Build().Run(); - return 0; - } - catch (Exception ex) - { - Log.Fatal(ex, "Host terminated unexpectedly"); - return 1; - } - finally - { - Log.CloseAndFlush(); - } - } - - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - webBuilder.UseSerilog(); - }); - } + app.UseExceptionHandler("/Home/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); } + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseRouting(); + +app.UseAuthorization(); + +app.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + +app.Run(); diff --git a/src/Debugger/Startup.cs b/src/Debugger/Startup.cs deleted file mode 100644 index 51c0262..0000000 --- a/src/Debugger/Startup.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -namespace Debugger -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddHostedService(); - services.AddControllers(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseRouting(); - - app.UseAuthorization(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} diff --git a/src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj b/src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj index 65e9556..9214664 100644 --- a/src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj +++ b/src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net8.0 false diff --git a/src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj b/src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj index 64fea97..4898ddb 100644 --- a/src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj +++ b/src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj @@ -14,8 +14,8 @@ - - + + From 41f47b421a3dcc9b903c5a3694d4b72d5212fd7f Mon Sep 17 00:00:00 2001 From: Adam Williams Date: Tue, 21 Nov 2023 12:31:48 +0000 Subject: [PATCH 2/2] Update README, change namespace/package --- .github/workflows/workflow.yml | 2 +- README.md | 10 +- src/Debugger/Debugger.csproj | 2 +- src/Debugger/appsettings.json | 4 +- ...Raileasy.Serilog.Stackdriver.Tests.csproj} | 42 ++-- .../StackdriverFormatterTests.cs | 210 +++++++++--------- .../CountingTextWriter.cs | 4 +- .../Raileasy.Serilog.Stackdriver.csproj} | 47 ++-- .../StackDriverLogLevel.cs | 4 +- .../StackdriverJsonFormatter.cs | 5 +- stackdriver-serilog.sln | 4 +- 11 files changed, 168 insertions(+), 166 deletions(-) rename src/{Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj => Raileasy.Serilog.Stackdriver.Tests/Raileasy.Serilog.Stackdriver.Tests.csproj} (76%) rename src/{Redbox.Serilog.Stackdriver.Tests => Raileasy.Serilog.Stackdriver.Tests}/StackdriverFormatterTests.cs (96%) rename src/{Redbox.Serilog.Stackdriver => Raileasy.Serilog.Stackdriver}/CountingTextWriter.cs (97%) rename src/{Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj => Raileasy.Serilog.Stackdriver/Raileasy.Serilog.Stackdriver.csproj} (69%) rename src/{Redbox.Serilog.Stackdriver => Raileasy.Serilog.Stackdriver}/StackDriverLogLevel.cs (98%) rename src/{Redbox.Serilog.Stackdriver => Raileasy.Serilog.Stackdriver}/StackdriverJsonFormatter.cs (99%) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2c0a33e..768a778 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -32,7 +32,7 @@ jobs: - name: Pack and Release id: pack_release run: | - PACKAGE="Redbox.Serilog.Stackdriver" + PACKAGE="Raileasy.Serilog.Stackdriver" echo ::set-output name=PACKAGE::$PACKAGE dotnet pack src/$PACKAGE --output nupkgs -p:Version=${{ steps.get_version.outputs.VERSION }} dotnet nuget push nupkgs/$PACKAGE.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json diff --git a/README.md b/README.md index a1d21f7..5254277 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Stackdriver Formatter for Serilog +**This is a fork of the original Redbox project, updated for Serilog v3 and with a .NET 8.0 example.** + A Stackdriver JSON Formatter for logging with Serilog and .NET. Useful when a dependency on the Google SDK is not wanted or when a logs are being sent to Stackdriver using a data collector or log shipper (e.g. Fluentd). ## Serilog Sinks @@ -8,18 +10,18 @@ There is no dependency on any particular Serilog Sinks. Pass in an instance of ## Installing -A `netstandard2.0` Nuget package is available [here](https://www.nuget.org/packages/Redbox.Serilog.Stackdriver/). +A `netstandard2.0` Nuget package is available [here](https://www.nuget.org/packages/Raileasy.Serilog.Stackdriver/). Or you can install with the dotnet cli: -`dotnet add package Redbox.Serilog.Stackdriver` +`dotnet add package Raileasy.Serilog.Stackdriver` ## Sample Setup Code ### Directly into a Serilog Instance ```csharp -using Redbox.Serilog.Stackdriver +using Raileasy.Serilog.Stackdriver Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() @@ -42,7 +44,7 @@ Be sure to add `.ReadFrom.Configuration(configuration)` to your Serilog setup fi { "Name": "Console", "Args": { - "formatter": "Redbox.Serilog.Stackdriver.StackdriverJsonFormatter, Redbox.Serilog.Stackdriver" + "formatter": "Raileasy.Serilog.Stackdriver.StackdriverJsonFormatter, Raileasy.Serilog.Stackdriver" } }] } diff --git a/src/Debugger/Debugger.csproj b/src/Debugger/Debugger.csproj index 2bb1253..1a8f55a 100644 --- a/src/Debugger/Debugger.csproj +++ b/src/Debugger/Debugger.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Debugger/appsettings.json b/src/Debugger/appsettings.json index 33c183d..3adc47b 100644 --- a/src/Debugger/appsettings.json +++ b/src/Debugger/appsettings.json @@ -16,7 +16,7 @@ { "Name": "Console", "Args": { - "formatter": "Redbox.Serilog.Stackdriver.StackdriverJsonFormatter, Redbox.Serilog.Stackdriver" + "formatter": "Raileasy.Serilog.Stackdriver.StackdriverJsonFormatter, Raileasy.Serilog.Stackdriver" } } ], @@ -29,4 +29,4 @@ "Application": "Sample" } } -} \ No newline at end of file +} diff --git a/src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj b/src/Raileasy.Serilog.Stackdriver.Tests/Raileasy.Serilog.Stackdriver.Tests.csproj similarity index 76% rename from src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj rename to src/Raileasy.Serilog.Stackdriver.Tests/Raileasy.Serilog.Stackdriver.Tests.csproj index 9214664..6ec9ffd 100644 --- a/src/Redbox.Serilog.Stackdriver.Tests/Redbox.Serilog.Stackdriver.Tests.csproj +++ b/src/Raileasy.Serilog.Stackdriver.Tests/Raileasy.Serilog.Stackdriver.Tests.csproj @@ -1,21 +1,21 @@ - - - - net8.0 - - false - - - - - - - - - - - - - - - + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + + diff --git a/src/Redbox.Serilog.Stackdriver.Tests/StackdriverFormatterTests.cs b/src/Raileasy.Serilog.Stackdriver.Tests/StackdriverFormatterTests.cs similarity index 96% rename from src/Redbox.Serilog.Stackdriver.Tests/StackdriverFormatterTests.cs rename to src/Raileasy.Serilog.Stackdriver.Tests/StackdriverFormatterTests.cs index 492809c..1040d7e 100644 --- a/src/Redbox.Serilog.Stackdriver.Tests/StackdriverFormatterTests.cs +++ b/src/Raileasy.Serilog.Stackdriver.Tests/StackdriverFormatterTests.cs @@ -1,105 +1,105 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Newtonsoft.Json; -using Serilog.Events; -using Serilog.Parsing; -using Xunit; - -namespace Redbox.Serilog.Stackdriver.Tests -{ - public class StackdriverFormatterTests - { - private static readonly DateTimeOffset DateTimeOffset = DateTimeOffset.Now; - - [Fact] - public void Test_StackdriverFormatter_Format() - { - var propertyName = "greeting"; - var propertyValue = "hello"; - var logEvent = new LogEvent(DateTimeOffset, LogEventLevel.Debug, new Exception(), - new MessageTemplate("{greeting}", - new MessageTemplateToken[] { new PropertyToken(propertyName, propertyValue, "l") }), - new LogEventProperty[0]); - - using var writer = new StringWriter(); - new StackdriverJsonFormatter().Format(logEvent, writer); - var logDict = GetLogLineAsDictionary(writer.ToString()); - - AssertValidLogLine(logDict); - Assert.True(logDict["message"] == propertyValue); - } - - [Fact] - public void Test_StackdrvierFormatter_FormatLong() - { - // Creates a large string > 200kb - var token = new TextToken(new string('*', 51200)); - var logEvent = new LogEvent(DateTimeOffset, LogEventLevel.Debug, - new Exception(), new MessageTemplate("{0}", new MessageTemplateToken[] { token }), - new LogEventProperty[0]); - - using var writer = new StringWriter(); - new StackdriverJsonFormatter().Format(logEvent, writer); - var lines = SplitLogLogs(writer.ToString()); - - // The log created was longer than Stackdriver's soft limit of 256 bytes - // This means the json will be spread out onto two lines, breaking search - // In this scenario the library should add an additional log event informing - // the user of this issue - Assert.True(lines.Length == 2); - // Validate each line is valid json - var ourLogLineDict = GetLogLineAsDictionary(lines[0]); - AssertValidLogLine(ourLogLineDict); - var errorLogLineDict = GetLogLineAsDictionary(lines[1]); - AssertValidLogLine(errorLogLineDict, hasException: false); - } - - private string[] SplitLogLogs(string logLines) - { - return logLines.Split("\n").Where(l => !string.IsNullOrWhiteSpace(l)).ToArray(); - } - - /// - /// Gets a log line in json format as a dictionary of string pairs - /// - /// - /// - private Dictionary GetLogLineAsDictionary(string log) - { - return JsonConvert.DeserializeObject>(log); - } - - /// - /// Asserts required fields in log output are set and have valid values - /// - /// - /// - private void AssertValidLogLine(Dictionary logDict, - bool hasException = true) - { - Assert.True(logDict.ContainsKey("message")); - Assert.NotEmpty(logDict["message"]); - - Assert.True(logDict.ContainsKey("timestamp")); - var timestamp = DateTimeOffset.UtcDateTime.ToString("O"); - Assert.Equal(logDict["timestamp"], timestamp); - - Assert.True(logDict.ContainsKey("fingerprint")); - Assert.NotEmpty(logDict["fingerprint"]); - - Assert.True(logDict.ContainsKey("severity")); - Assert.NotEmpty(logDict["severity"]); - - Assert.True(logDict.ContainsKey(("MessageTemplate"))); - Assert.NotEmpty(logDict["MessageTemplate"]); - - if (hasException) - { - Assert.True(logDict.ContainsKey("exception")); - Assert.NotEmpty(logDict["exception"]); - } - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Newtonsoft.Json; +using Serilog.Events; +using Serilog.Parsing; +using Xunit; + +namespace Raileasy.Serilog.Stackdriver.Tests +{ + public class StackdriverFormatterTests + { + private static readonly DateTimeOffset DateTimeOffset = DateTimeOffset.Now; + + [Fact] + public void Test_StackdriverFormatter_Format() + { + var propertyName = "greeting"; + var propertyValue = "hello"; + var logEvent = new LogEvent(DateTimeOffset, LogEventLevel.Debug, new Exception(), + new MessageTemplate("{greeting}", + new MessageTemplateToken[] { new PropertyToken(propertyName, propertyValue, "l") }), + new LogEventProperty[0]); + + using var writer = new StringWriter(); + new StackdriverJsonFormatter().Format(logEvent, writer); + var logDict = GetLogLineAsDictionary(writer.ToString()); + + AssertValidLogLine(logDict); + Assert.True(logDict["message"] == propertyValue); + } + + [Fact] + public void Test_StackdrvierFormatter_FormatLong() + { + // Creates a large string > 200kb + var token = new TextToken(new string('*', 51200)); + var logEvent = new LogEvent(DateTimeOffset, LogEventLevel.Debug, + new Exception(), new MessageTemplate("{0}", new MessageTemplateToken[] { token }), + new LogEventProperty[0]); + + using var writer = new StringWriter(); + new StackdriverJsonFormatter().Format(logEvent, writer); + var lines = SplitLogLogs(writer.ToString()); + + // The log created was longer than Stackdriver's soft limit of 256 bytes + // This means the json will be spread out onto two lines, breaking search + // In this scenario the library should add an additional log event informing + // the user of this issue + Assert.True(lines.Length == 2); + // Validate each line is valid json + var ourLogLineDict = GetLogLineAsDictionary(lines[0]); + AssertValidLogLine(ourLogLineDict); + var errorLogLineDict = GetLogLineAsDictionary(lines[1]); + AssertValidLogLine(errorLogLineDict, hasException: false); + } + + private string[] SplitLogLogs(string logLines) + { + return logLines.Split("\n").Where(l => !string.IsNullOrWhiteSpace(l)).ToArray(); + } + + /// + /// Gets a log line in json format as a dictionary of string pairs + /// + /// + /// + private Dictionary GetLogLineAsDictionary(string log) + { + return JsonConvert.DeserializeObject>(log); + } + + /// + /// Asserts required fields in log output are set and have valid values + /// + /// + /// + private void AssertValidLogLine(Dictionary logDict, + bool hasException = true) + { + Assert.True(logDict.ContainsKey("message")); + Assert.NotEmpty(logDict["message"]); + + Assert.True(logDict.ContainsKey("timestamp")); + var timestamp = DateTimeOffset.UtcDateTime.ToString("O"); + Assert.Equal(logDict["timestamp"], timestamp); + + Assert.True(logDict.ContainsKey("fingerprint")); + Assert.NotEmpty(logDict["fingerprint"]); + + Assert.True(logDict.ContainsKey("severity")); + Assert.NotEmpty(logDict["severity"]); + + Assert.True(logDict.ContainsKey(("MessageTemplate"))); + Assert.NotEmpty(logDict["MessageTemplate"]); + + if (hasException) + { + Assert.True(logDict.ContainsKey("exception")); + Assert.NotEmpty(logDict["exception"]); + } + } + } +} diff --git a/src/Redbox.Serilog.Stackdriver/CountingTextWriter.cs b/src/Raileasy.Serilog.Stackdriver/CountingTextWriter.cs similarity index 97% rename from src/Redbox.Serilog.Stackdriver/CountingTextWriter.cs rename to src/Raileasy.Serilog.Stackdriver/CountingTextWriter.cs index 191037a..d021c7c 100644 --- a/src/Redbox.Serilog.Stackdriver/CountingTextWriter.cs +++ b/src/Raileasy.Serilog.Stackdriver/CountingTextWriter.cs @@ -19,7 +19,7 @@ using System.IO; using System.Text; -namespace Redbox.Serilog.Stackdriver +namespace Raileasy.Serilog.Stackdriver { /// /// Custom minimal text writer that will pass-through to a provided text writer but whilst doing so will @@ -51,4 +51,4 @@ public override void Write(char value) originalOutput.Write(value); } } -} \ No newline at end of file +} diff --git a/src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj b/src/Raileasy.Serilog.Stackdriver/Raileasy.Serilog.Stackdriver.csproj similarity index 69% rename from src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj rename to src/Raileasy.Serilog.Stackdriver/Raileasy.Serilog.Stackdriver.csproj index 4898ddb..4f9db57 100644 --- a/src/Redbox.Serilog.Stackdriver/Redbox.Serilog.Stackdriver.csproj +++ b/src/Raileasy.Serilog.Stackdriver/Raileasy.Serilog.Stackdriver.csproj @@ -1,23 +1,24 @@ - - - - netstandard2.0 - Redbox.Serilog.Stackdriver - Redbox - A Serilog Formatter for Stackdriver using JSON logs - false - Copyright 2019 (c) Redbox Automated Retail, LLC - serilog stackdriver json log logging google - https://github.com/redboxllc/stackdriver-serilog.git - git - true - - - - - - - - - - + + + + netstandard2.0 + Raileasy.Serilog.Stackdriver + Redbox + A Serilog Formatter for Stackdriver using JSON logs + false + Copyright 2019 (c) Redbox Automated Retail, LLC + serilog stackdriver json log logging google + https://github.com/raileasyuk/stackdriver-serilog.git + git + Apache-2.0 + true + + + + + + + + + + diff --git a/src/Redbox.Serilog.Stackdriver/StackDriverLogLevel.cs b/src/Raileasy.Serilog.Stackdriver/StackDriverLogLevel.cs similarity index 98% rename from src/Redbox.Serilog.Stackdriver/StackDriverLogLevel.cs rename to src/Raileasy.Serilog.Stackdriver/StackDriverLogLevel.cs index ef12ddf..6ce2935 100644 --- a/src/Redbox.Serilog.Stackdriver/StackDriverLogLevel.cs +++ b/src/Raileasy.Serilog.Stackdriver/StackDriverLogLevel.cs @@ -18,7 +18,7 @@ using Serilog.Events; -namespace Redbox.Serilog.Stackdriver +namespace Raileasy.Serilog.Stackdriver { /// /// Mappings of Microsoft/Serilog Log Levels to Stackdriver @@ -56,4 +56,4 @@ public static string GetSeverity(LogEventLevel level) } } } -} \ No newline at end of file +} diff --git a/src/Redbox.Serilog.Stackdriver/StackdriverJsonFormatter.cs b/src/Raileasy.Serilog.Stackdriver/StackdriverJsonFormatter.cs similarity index 99% rename from src/Redbox.Serilog.Stackdriver/StackdriverJsonFormatter.cs rename to src/Raileasy.Serilog.Stackdriver/StackdriverJsonFormatter.cs index 3dba015..a9eef78 100644 --- a/src/Redbox.Serilog.Stackdriver/StackdriverJsonFormatter.cs +++ b/src/Raileasy.Serilog.Stackdriver/StackdriverJsonFormatter.cs @@ -25,9 +25,8 @@ using Serilog.Formatting; using Serilog.Parsing; using System.Collections.Generic; -using System.Linq; -namespace Redbox.Serilog.Stackdriver +namespace Raileasy.Serilog.Stackdriver { /// /// Custom JSON formatter based on the built-in RenderedCompactJsonFormatter @@ -165,4 +164,4 @@ public static void WriteKeyValue(TextWriter output, JsonValueFormatter formatter formatter.Format(value, output); } } -} \ No newline at end of file +} diff --git a/stackdriver-serilog.sln b/stackdriver-serilog.sln index 125e644..dbb5148 100644 --- a/stackdriver-serilog.sln +++ b/stackdriver-serilog.sln @@ -7,9 +7,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D847B27B-033 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger", "src\Debugger\Debugger.csproj", "{8AB26D0D-C70B-4B3C-9992-2E1D06D8E15E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redbox.Serilog.Stackdriver", "src\Redbox.Serilog.Stackdriver\Redbox.Serilog.Stackdriver.csproj", "{8A7D3706-F5B4-4BDC-BE8E-156EC4EA9795}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raileasy.Serilog.Stackdriver", "src\Raileasy.Serilog.Stackdriver\Raileasy.Serilog.Stackdriver.csproj", "{8A7D3706-F5B4-4BDC-BE8E-156EC4EA9795}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Redbox.Serilog.Stackdriver.Tests", "src\Redbox.Serilog.Stackdriver.Tests\Redbox.Serilog.Stackdriver.Tests.csproj", "{A40DA383-9EDB-4159-A419-AC7B6CB0EDFF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raileasy.Serilog.Stackdriver.Tests", "src\Raileasy.Serilog.Stackdriver.Tests\Raileasy.Serilog.Stackdriver.Tests.csproj", "{A40DA383-9EDB-4159-A419-AC7B6CB0EDFF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution