NetChris.Logging.AspNetCore
1.0.444318882-pre
This is a prerelease version of NetChris.Logging.AspNetCore.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package NetChris.Logging.AspNetCore --version 1.0.444318882-pre
NuGet\Install-Package NetChris.Logging.AspNetCore -Version 1.0.444318882-pre
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetChris.Logging.AspNetCore" Version="1.0.444318882-pre" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetChris.Logging.AspNetCore --version 1.0.444318882-pre
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetChris.Logging.AspNetCore, 1.0.444318882-pre"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetChris.Logging.AspNetCore as a Cake Addin #addin nuget:?package=NetChris.Logging.AspNetCore&version=1.0.444318882-pre&prerelease // Install NetChris.Logging.AspNetCore as a Cake Tool #tool nuget:?package=NetChris.Logging.AspNetCore&version=1.0.444318882-pre&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetChris.Logging.AspNetCore
Usage
- For a .NET 6 app, your
Program.cs
file should be configured thusly:
using NetChris.Logging.AspNetCore.Extensions;
using Serilog;
// See https://nblumhardt.com/2020/10/bootstrap-logger/
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.CreateBootstrapLogger();
try
{
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddNetChrisLogging();
// SERVICES SETUP
var app = builder.Build();
app.UseNetChrisLogging();
// REMAINDER OF APP SETUP
app.Run();
}
catch (Exception ex)
{
Log.Fatal(ex, "An unhandled exception occured during bootstrapping");
}
finally
{
Log.CloseAndFlush();
}
- If you are still using
Program.cs
andSetup.cs
, it'll look something like this:
// Program.cs
public static void Main(string[] args)
{
// See https://nblumhardt.com/2020/10/bootstrap-logger/
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.CreateBootstrapLogger();
try
{
CreateHostBuilder(args).Build().Run();
}
catch (Exception ex)
{
Log.Fatal(ex, "An unhandled exception occured during bootstrapping");
}
finally
{
Log.CloseAndFlush();
}
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
var hostBuilder =
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); })
.AddNetChrisLogging();
return hostBuilder;
}
// Startup.cs
public void Configure(IApplicationBuilder app)
{
app.UseMiddleware<RequestLogScopeMiddleware>();
}
Seq setup
In order for logging to go to Seq, you'll need some configuration keys in environment variables:
Secrets:seq:serverUrl
Secrets:seq:apiKey
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- NetChris.Build.MSBuild (>= 1.1.444315244)
- NetChris.Logging (>= 1.0.444318882-pre)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.0.444323398 | 398 | 1/9/2022 | |
1.0.444318882-pre | 222 | 1/9/2022 | |
1.0.444316742-pre | 209 | 1/9/2022 | |
1.0.444290610 | 310 | 1/9/2022 | |
1.0.444285672-pre | 221 | 1/9/2022 | |
1.0.444282192-pre | 218 | 1/9/2022 | |
0.10.440123869-pre | 205 | 1/2/2022 | |
0.9.439862951 | 344 | 1/1/2022 | |
0.9.439861426-pre | 201 | 1/1/2022 | |
0.8.77 | 463 | 7/12/2021 | |
0.7.69 | 413 | 7/11/2021 | |
0.6.55 | 485 | 11/11/2020 | |
0.6.52-pr-dotnet5 | 407 | 10/11/2020 | |
0.6.51-pr-dotnet5 | 441 | 10/10/2020 | |
0.6.50-pr-1-coordination-id | 429 | 10/10/2020 | |
0.5.48-pr-1-coordination-id | 453 | 10/10/2020 | |
0.5.45-pr-update-references | 520 | 10/10/2020 | |
0.5.43-pr-dotnet5 | 451 | 8/16/2020 | |
0.5.37-pr-3-updates | 409 | 8/16/2020 | |
0.5.36-pr-3-updates | 459 | 8/16/2020 | |
0.4.28 | 548 | 8/15/2020 |