feat: Add serilog (#5)
This commit is contained in:
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -124,6 +124,14 @@ jobs:
|
|||||||
"Microsoft.AspNetCore" = "Warning"
|
"Microsoft.AspNetCore" = "Warning"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Seq = @{
|
||||||
|
ServerUrl = "https://log.azaaxin.com"
|
||||||
|
ApiKey = "KEY"
|
||||||
|
MinimumLevel = "Trace"
|
||||||
|
LevelOverride = @{
|
||||||
|
Microsoft: "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
ApiConfiguration = @{
|
ApiConfiguration = @{
|
||||||
EspConfiguration = @{
|
EspConfiguration = @{
|
||||||
InformationBoardImageUrl = "http://server_ip:port/home/default.jpg"
|
InformationBoardImageUrl = "http://server_ip:port/home/default.jpg"
|
||||||
@@ -178,6 +186,14 @@ jobs:
|
|||||||
"Microsoft.AspNetCore" = "Warning"
|
"Microsoft.AspNetCore" = "Warning"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Seq = @{
|
||||||
|
ServerUrl = ${{ vars.SEQ_URL }}
|
||||||
|
ApiKey = ${{ secrets.seq_api_key }}
|
||||||
|
MinimumLevel = "Trace"
|
||||||
|
LevelOverride = @{
|
||||||
|
Microsoft: "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
ApiConfiguration = @{
|
ApiConfiguration = @{
|
||||||
EspConfiguration = @{
|
EspConfiguration = @{
|
||||||
InformationBoardImageUrl = "${{ vars.ESP_IMAGE_URL }}"
|
InformationBoardImageUrl = "${{ vars.ESP_IMAGE_URL }}"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<PackageReference Include="RazorLight" Version="2.3.1" />
|
<PackageReference Include="RazorLight" Version="2.3.1" />
|
||||||
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
|
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
|
||||||
<PackageReference Include="Scalar.AspNetCore" Version="2.5.6" />
|
<PackageReference Include="Scalar.AspNetCore" Version="2.5.6" />
|
||||||
|
<PackageReference Include="Seq.Extensions.Logging" Version="8.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -30,5 +31,8 @@
|
|||||||
<Content Include="wwwroot\index.cshtml">
|
<Content Include="wwwroot\index.cshtml">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="..\.github\workflows\build.yml">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
using HomeApi.Registration;
|
using HomeApi.Registration;
|
||||||
using Scalar.AspNetCore;
|
using Scalar.AspNetCore;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Services.AddLogging(loggingBuilder =>
|
||||||
|
{
|
||||||
|
loggingBuilder.AddSeq(builder.Configuration.GetSection("Seq"));
|
||||||
|
});
|
||||||
builder.Services.AddHttpClient();
|
builder.Services.AddHttpClient();
|
||||||
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<Program>());
|
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<Program>());
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|||||||
@@ -12,6 +12,14 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Seq": {
|
||||||
|
"ServerUrl": "https://log.azaaxin.com",
|
||||||
|
"ApiKey": "KEY",
|
||||||
|
"MinimumLevel": "Trace",
|
||||||
|
"LevelOverride": {
|
||||||
|
"Microsoft": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ApiConfiguration": {
|
"ApiConfiguration": {
|
||||||
"EspConfiguration": {
|
"EspConfiguration": {
|
||||||
"InformationBoardImageUrl": "http://192.168.101.178:5000/home/default.jpg",
|
"InformationBoardImageUrl": "http://192.168.101.178:5000/home/default.jpg",
|
||||||
|
|||||||
@@ -12,6 +12,14 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Seq": {
|
||||||
|
"ServerUrl": "https://log.azaaxin.com",
|
||||||
|
"ApiKey": "KEY",
|
||||||
|
"MinimumLevel": "Trace",
|
||||||
|
"LevelOverride": {
|
||||||
|
"Microsoft": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ApiConfiguration": {
|
"ApiConfiguration": {
|
||||||
"EspConfiguration": {
|
"EspConfiguration": {
|
||||||
"InformationBoardImageUrl": "http://192.168.101.178:5000/home/default.jpg",
|
"InformationBoardImageUrl": "http://192.168.101.178:5000/home/default.jpg",
|
||||||
|
|||||||
Reference in New Issue
Block a user