Skip to content

Commit

Permalink
删除数据库日志
Browse files Browse the repository at this point in the history
  • Loading branch information
239573049 committed Nov 10, 2024
1 parent f8cba51 commit 32e3780
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/NuGet.Next.DM/DMApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Next.Core;
using NuGet.Next.Options;

Expand All @@ -14,6 +15,8 @@ public static BaGetApplication AddDMDatabase(this BaGetApplication app)
var databaseOptions = provider.GetRequiredService<NuGetNextOptions>();

options.UseDm(databaseOptions.Database.ConnectionString);

options.UseLoggerFactory((new NullLoggerFactory()));
});

return app;
Expand Down
3 changes: 3 additions & 0 deletions src/NuGet.Next.MySql/MySqlApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using NuGet.Next.Core;
using NuGet.Next.Options;
Expand All @@ -16,6 +17,8 @@ public static BaGetApplication AddMySqlDatabase(this BaGetApplication app)

options.UseMySql(databaseOptions.Database.ConnectionString,
ServerVersion.AutoDetect(databaseOptions.Database.ConnectionString));

options.UseLoggerFactory((new NullLoggerFactory()));
});

return app;
Expand Down
2 changes: 2 additions & 0 deletions src/NuGet.Next.PostgreSql/PostgreSqlApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Next.Core;
using NuGet.Next.Options;

Expand All @@ -17,6 +18,7 @@ public static BaGetApplication AddPostgreSqlDatabase(this BaGetApplication app)
var databaseOptions = provider.GetRequiredService<NuGetNextOptions>();

options.UseNpgsql(databaseOptions.Database.ConnectionString);
options.UseLoggerFactory((new NullLoggerFactory()));
});

return app;
Expand Down
2 changes: 2 additions & 0 deletions src/NuGet.Next.SqlServer/SqlServerApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Next.Core;
using NuGet.Next.Options;

Expand All @@ -15,6 +16,7 @@ public static BaGetApplication AddSqlServerDatabase(this BaGetApplication app)
var databaseOptions = provider.GetRequiredService<NuGetNextOptions>();

options.UseSqlServer(databaseOptions.Database.ConnectionString);
options.UseLoggerFactory((new NullLoggerFactory()));
});

return app;
Expand Down
3 changes: 3 additions & 0 deletions src/NuGet.Next.Sqlite/SqliteApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Next.Core;
using NuGet.Next.Options;
using NuGet.Next.Sqlite;
Expand All @@ -14,6 +15,8 @@ public static BaGetApplication AddSqliteDatabase(this BaGetApplication app)
{
var option = provider.GetRequiredService<NuGetNextOptions>();
options.UseSqlite(option.Database.ConnectionString);

options.UseLoggerFactory((new NullLoggerFactory()));
});

return app;
Expand Down

0 comments on commit 32e3780

Please sign in to comment.