mirror of https://github.com/jellyfin/jellyfin.git
Use default ASP.NET Core logger factory for DbContext factory
This commit is contained in:
parent
8479f0f90c
commit
f3e5139cfc
|
@ -4,7 +4,6 @@ using EFCoreSecondLevelCacheInterceptor;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Jellyfin.Server.Implementations.Extensions;
|
namespace Jellyfin.Server.Implementations.Extensions;
|
||||||
|
|
||||||
|
@ -32,10 +31,8 @@ public static class ServiceCollectionExtensions
|
||||||
serviceCollection.AddPooledDbContextFactory<JellyfinDbContext>((serviceProvider, opt) =>
|
serviceCollection.AddPooledDbContextFactory<JellyfinDbContext>((serviceProvider, opt) =>
|
||||||
{
|
{
|
||||||
var applicationPaths = serviceProvider.GetRequiredService<IApplicationPaths>();
|
var applicationPaths = serviceProvider.GetRequiredService<IApplicationPaths>();
|
||||||
var loggerFactory = serviceProvider.GetRequiredService<ILoggerFactory>();
|
|
||||||
opt.UseSqlite($"Filename={Path.Combine(applicationPaths.DataPath, "jellyfin.db")}")
|
opt.UseSqlite($"Filename={Path.Combine(applicationPaths.DataPath, "jellyfin.db")}")
|
||||||
.AddInterceptors(serviceProvider.GetRequiredService<SecondLevelCacheInterceptor>())
|
.AddInterceptors(serviceProvider.GetRequiredService<SecondLevelCacheInterceptor>());
|
||||||
.UseLoggerFactory(loggerFactory);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return serviceCollection;
|
return serviceCollection;
|
||||||
|
|
Loading…
Reference in New Issue