![]() |
VOOZH | about |
dotnet add package Itmo.Dev.Platform.Logging --version 1.2.388
NuGet\Install-Package Itmo.Dev.Platform.Logging -Version 1.2.388
<PackageReference Include="Itmo.Dev.Platform.Logging" Version="1.2.388" />
<PackageVersion Include="Itmo.Dev.Platform.Logging" Version="1.2.388" />Directory.Packages.props
<PackageReference Include="Itmo.Dev.Platform.Logging" />Project file
paket add Itmo.Dev.Platform.Logging --version 1.2.388
#r "nuget: Itmo.Dev.Platform.Logging, 1.2.388"
#:package Itmo.Dev.Platform.Logging@1.2.388
#addin nuget:?package=Itmo.Dev.Platform.Logging&version=1.2.388Install as a Cake Addin
#tool nuget:?package=Itmo.Dev.Platform.Logging&version=1.2.388Install as a Cake Tool
Package contains methods to connect Serilog and Sink to Sentry.
Usage example:
builder.AddPlatformSentry();
builder.Host.AddPlatformSerilog(builder.Configuration);
// ...
var app = builder.Build();
app.UseRouting();
// UsePlatformSentryTracing should be placed right after UseRouting middleware
app.UsePlatformSentryTracing(builder.Configuration);
Sentry application settings example:
{
"Sentry": {
"Enabled": true,
"Environment": "Production",
"Dsn": "",
"Debug": false,
"TracesSampleRate": 1.0,
"MinimumEventLevel": "Warning"
}
}
Serilog application settings example:
{
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File"
],
"MinimumLevel": {
"Default": "Verbose",
"Override": {
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Warning",
"Grpc.AspNetCore.Server.Model.Internal": "Information"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "{Timestamp:T} [{Level:u3}] {SourceContext} {Message}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "Serilogs/${ApplicationName}/AppLogs_.log",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:o} [{Level:u3}] {SourceContext} {Message}{NewLine}{Exception}",
"retainedFileCountLimit": 30
}
}
]
}
}
N.B.
Don't forget to add required Sinks:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
Itmo.Dev.Platform