mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 12:54:20 +01:00
Compare commits
4 Commits
9f2b5ef49a
...
21995925b0
Author | SHA1 | Date | |
---|---|---|---|
|
21995925b0 | ||
|
d90145321f | ||
|
8651ea50b6 | ||
|
3722bd1a83 |
2
DotBased
2
DotBased
|
@ -1 +1 @@
|
||||||
Subproject commit 58739c2aeadc7e608359a20cd3ada2d447284c22
|
Subproject commit a3be0d96480892a6b2e13ebae30a636389373bbb
|
|
@ -7,6 +7,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\DotBased\DotBased.Logging.MEL\DotBased.Logging.MEL.csproj" />
|
||||||
<ProjectReference Include="..\SharpRSS.Business\SharpRSS.Business.csproj" />
|
<ProjectReference Include="..\SharpRSS.Business\SharpRSS.Business.csproj" />
|
||||||
<ProjectReference Include="..\SharpRSS.Core\SharpRSS.Core.csproj" />
|
<ProjectReference Include="..\SharpRSS.Core\SharpRSS.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -4,53 +4,15 @@
|
||||||
"Server": "SQLite",
|
"Server": "SQLite",
|
||||||
"Connection": "Data Source=SRSS.db"
|
"Connection": "Data Source=SRSS.db"
|
||||||
},
|
},
|
||||||
"Serilog": {
|
|
||||||
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
|
||||||
"MinimumLevel": {
|
|
||||||
"Default": "Debug",
|
|
||||||
"Override": {
|
|
||||||
"System": "Information",
|
|
||||||
"Microsoft": "Debug",
|
|
||||||
"Microsoft.Hosting.Lifetime": "Debug",
|
|
||||||
"Microsoft.AspNetCore": "Debug",
|
|
||||||
"Microsoft.AspNetCore.Authentication": "Debug"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WriteTo": [
|
|
||||||
{
|
|
||||||
"Name": "Console",
|
|
||||||
"Args":
|
|
||||||
{
|
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} - {Caller}->{Assembly}] | {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args":
|
|
||||||
{
|
|
||||||
"path": "Logs/Debug/log_.log",
|
|
||||||
"RollingInterval": "Day",
|
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} - {Caller}->{Assembly}] | {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Destructure": [
|
|
||||||
{ "Name": "ToMaximumDepth", "Args": { "maximumDestructuringDepth": 4 } },
|
|
||||||
{ "Name": "ToMaximumStringLength", "Args": { "maximumStringLength": 100 } },
|
|
||||||
{ "Name": "ToMaximumCollectionCount", "Args": { "maximumCollectionCount": 10 } }
|
|
||||||
],
|
|
||||||
"Properties": {
|
|
||||||
"Application": "SharpRSS"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"HTTP":
|
"HTTP":
|
||||||
{
|
{
|
||||||
"HSTS":
|
"HSTS":
|
||||||
{
|
{
|
||||||
"EnableHSTS": true,
|
"EnableHSTS": true,
|
||||||
"MaxAgeSeconds": 300,
|
"MaxAgeSeconds": 31536000,
|
||||||
"IncludeSubdomains": true,
|
"IncludeSubdomains": true,
|
||||||
"Preload": true
|
"Preload": true
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,45 +4,6 @@
|
||||||
"Server": "SQLite",
|
"Server": "SQLite",
|
||||||
"Connection": "Data Source=SRSS.db"
|
"Connection": "Data Source=SRSS.db"
|
||||||
},
|
},
|
||||||
"Serilog": {
|
|
||||||
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
|
||||||
"MinimumLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Override": {
|
|
||||||
"System": "Information",
|
|
||||||
"Microsoft": "Information",
|
|
||||||
"Microsoft.Hosting.Lifetime": "Information",
|
|
||||||
"Microsoft.AspNetCore": "Warning",
|
|
||||||
"Microsoft.AspNetCore.Authentication": "Information"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WriteTo": [
|
|
||||||
{
|
|
||||||
"Name": "Console",
|
|
||||||
"Args":
|
|
||||||
{
|
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} - {Caller}->{Assembly}] | {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args":
|
|
||||||
{
|
|
||||||
"path": "Logs/Debug/log_.log",
|
|
||||||
"RollingInterval": "Day",
|
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} - {Caller}->{Assembly}] | {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Destructure": [
|
|
||||||
{ "Name": "ToMaximumDepth", "Args": { "maximumDestructuringDepth": 4 } },
|
|
||||||
{ "Name": "ToMaximumStringLength", "Args": { "maximumStringLength": 100 } },
|
|
||||||
{ "Name": "ToMaximumCollectionCount", "Args": { "maximumCollectionCount": 10 } }
|
|
||||||
],
|
|
||||||
"Properties": {
|
|
||||||
"Application": "SharpRSS"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"HTTP":
|
"HTTP":
|
||||||
{
|
{
|
||||||
"HSTS":
|
"HSTS":
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using DotBased.ASP.Auth;
|
|
||||||
using DotBased.Logging;
|
using DotBased.Logging;
|
||||||
using DotBased.Logging.Serilog;
|
using DotBased.Logging.Serilog;
|
||||||
|
using DotBased.Logging.MEL;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
@ -19,16 +19,32 @@ public static class DependencyInjection
|
||||||
public static WebApplicationBuilder AddSRSS(this WebApplicationBuilder builder)
|
public static WebApplicationBuilder AddSRSS(this WebApplicationBuilder builder)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Logging (serilog)
|
* Logging
|
||||||
*/
|
*/
|
||||||
var serilogConfig = new LoggerConfiguration().ReadFrom.Configuration(builder.Configuration).UseBasedExtension();
|
LogService.Initialize(options =>
|
||||||
Log.Logger = serilogConfig.CreateLogger();
|
{
|
||||||
|
options.Severity = LogSeverity.Verbose;
|
||||||
|
options.AddSeverityFilter("Microsoft", LogSeverity.Info);
|
||||||
|
options.AddSeverityFilter("Microsoft.Hosting.Lifetime", LogSeverity.Info);
|
||||||
|
options.AddSeverityFilter("Microsoft.AspNetCore", LogSeverity.Warning);
|
||||||
|
options.AddSeverityFilter("Microsoft.AspNetCore.Authentication", LogSeverity.Info);
|
||||||
|
options.AddSeverityFilter("MudBlazor", LogSeverity.Info);
|
||||||
|
});
|
||||||
|
Log.Logger = new LoggerConfiguration().UseBasedExtension()
|
||||||
|
.MinimumLevel.Verbose()
|
||||||
|
.Enrich.WithProperty("Application", "SharpRSS")
|
||||||
|
.WriteTo.Console(outputTemplate: BasedSerilog.OutputTemplate)
|
||||||
|
.WriteTo.File(path: Path.Combine("Logs", "Debug", "log_.log"), rollingInterval: RollingInterval.Day, outputTemplate: BasedSerilog.OutputTemplate)
|
||||||
|
.Destructure.ToMaximumDepth(4)
|
||||||
|
.Destructure.ToMaximumStringLength(100)
|
||||||
|
.Destructure.ToMaximumCollectionCount(10).CreateLogger();
|
||||||
|
|
||||||
LogService.AddLogAdapter(new BasedSerilogAdapter(Log.Logger));
|
LogService.AddLogAdapter(new BasedSerilogAdapter(Log.Logger));
|
||||||
var _logger = LogService.RegisterLogger(typeof(DependencyInjection));
|
var _logger = LogService.RegisterLogger(typeof(DependencyInjection));
|
||||||
|
|
||||||
builder.Logging.ClearProviders();
|
builder.Logging.ClearProviders();
|
||||||
builder.Logging.AddSerilog();
|
builder.Logging.SetMinimumLevel(LogLevel.Trace);
|
||||||
|
builder.Logging.AddDotBasedLoggerProvider(LogService.Options);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* EF Core DbContextFactory
|
* EF Core DbContextFactory
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using DotBased;
|
using DotBased;
|
||||||
using DotBased.ASP.Auth.Domains;
|
using DotBased.ASP.Auth.Domains;
|
||||||
using DotBased.Logging;
|
using DotBased.Logging;
|
||||||
using SharpRSS.Data.Domains.Auth;
|
|
||||||
|
|
||||||
namespace SharpRSS.Business.Services;
|
namespace SharpRSS.Business.Services;
|
||||||
|
|
||||||
|
@ -9,7 +8,7 @@ public class AuthService
|
||||||
{
|
{
|
||||||
public AuthService()
|
public AuthService()
|
||||||
{
|
{
|
||||||
_logger = LogService.RegisterLogger(typeof(AuthService));
|
_logger = LogService.RegisterLogger<AuthService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\DotBased\DotBased.ASP.Auth\DotBased.ASP.Auth.csproj" />
|
<ProjectReference Include="..\DotBased\DotBased.ASP.Auth\DotBased.ASP.Auth.csproj" />
|
||||||
|
<ProjectReference Include="..\DotBased\DotBased.Logging.MEL\DotBased.Logging.MEL.csproj" />
|
||||||
<ProjectReference Include="..\DotBased\DotBased.Logging.Serilog\DotBased.Logging.Serilog.csproj" />
|
<ProjectReference Include="..\DotBased\DotBased.Logging.Serilog\DotBased.Logging.Serilog.csproj" />
|
||||||
<ProjectReference Include="..\DotBased\DotBased\DotBased.csproj" />
|
<ProjectReference Include="..\DotBased\DotBased\DotBased.csproj" />
|
||||||
<ProjectReference Include="..\SharpRSS.Core\SharpRSS.Core.csproj" />
|
<ProjectReference Include="..\SharpRSS.Core\SharpRSS.Core.csproj" />
|
||||||
|
|
|
@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotBased.Logging.Serilog",
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotBased.ASP.Auth", "DotBased\DotBased.ASP.Auth\DotBased.ASP.Auth.csproj", "{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotBased.ASP.Auth", "DotBased\DotBased.ASP.Auth\DotBased.ASP.Auth.csproj", "{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotBased.Logging.MEL", "DotBased\DotBased.Logging.MEL\DotBased.Logging.MEL.csproj", "{BDE9E9B4-4665-4EA6-BF4E-2341F0E0529E}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -53,6 +55,10 @@ Global
|
||||||
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}.Release|Any CPU.Build.0 = Release|Any CPU
|
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BDE9E9B4-4665-4EA6-BF4E-2341F0E0529E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{BDE9E9B4-4665-4EA6-BF4E-2341F0E0529E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BDE9E9B4-4665-4EA6-BF4E-2341F0E0529E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BDE9E9B4-4665-4EA6-BF4E-2341F0E0529E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -64,5 +70,6 @@ Global
|
||||||
{F2BA5122-C9EE-4E65-B3EF-987D797AEAB0} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
{F2BA5122-C9EE-4E65-B3EF-987D797AEAB0} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
||||||
{49F07625-B92C-439B-AC3E-7DEB26EA15D4} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
{49F07625-B92C-439B-AC3E-7DEB26EA15D4} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
||||||
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
{18CEAA37-B46A-4543-9E7B-5BF12CFF9172} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
||||||
|
{BDE9E9B4-4665-4EA6-BF4E-2341F0E0529E} = {A73E4832-235F-4032-825E-3A928199A5DF}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user