Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrmee committed Jun 8, 2023
1 parent 104ea0e commit bca4821
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Presentation/Configurations/ServiceCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public static void RegisterGeneralAppServices(IServiceCollection services)

public static void RegisterAuthenticationServices(IServiceCollection services, AppSettings? appSettings)
{
services.AddIdentity<User, IdentityRole>()
.AddEntityFrameworkStores<BookStoreDbContext>();

services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
Expand Down Expand Up @@ -88,7 +91,7 @@ public static void RegisterApplicationServices(IServiceCollection services)
services.AddScoped<ICategoryService, CategoryService>();
services.AddScoped<IOrderService, OrderService>();
services.AddScoped<IOrderDetailService, OrderDetailService>();
//services.AddScoped<IAuthenticationService, AuthenticationService>();
services.AddScoped<IAuthenticationService, AuthenticationService>();
}

public static void RegisterRepositories(IServiceCollection services)
Expand Down Expand Up @@ -124,15 +127,15 @@ public static void RegisterAutoMapper(IServiceCollection services) =>
public static void RegisterSerilogServices(IServiceCollection services, ConfigureHostBuilder hostBuilder, string connectionString)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.Enrich.WithProperty("OS", Environment.OSVersion)
.Enrich.WithProperty("MachineName", Environment.MachineName)
.Enrich.WithProperty("ProcessId", Environment.ProcessId)
.Enrich.WithProperty("ThreadId", Environment.CurrentManagedThreadId)
.WriteTo.Console()
.WriteTo.PostgreSQL(connectionString, "Logs", needAutoCreateTable: true, restrictedToMinimumLevel: LogEventLevel.Information)
.CreateLogger();
.MinimumLevel.Override("Microsoft", LogEventLevel.Information).Enrich
.FromLogContext().Enrich
.WithProperty("OS", Environment.OSVersion).Enrich
.WithProperty("MachineName", Environment.MachineName).Enrich
.WithProperty("ProcessId", Environment.ProcessId).Enrich
.WithProperty("ThreadId", Environment.CurrentManagedThreadId).WriteTo
.Console().WriteTo
.PostgreSQL(connectionString, "Logs", needAutoCreateTable: true, restrictedToMinimumLevel: LogEventLevel.Information)
.CreateLogger();

hostBuilder.UseSerilog();

Expand Down

0 comments on commit bca4821

Please sign in to comment.