This package extends DbUp logging by enabling using Microsoft.Extensions.Logging.ILogger that's registered in Microsoft Dependency Injection (i.e., IServiceProvider).
$ dotnet add package DbUp.Extensions.Microsoft.LoggingDbUp.Extensions.Microsoft.Logging extends DbUp logging by enabling using Microsoft.Extensions.Logging.ILogger that's registered in Microsoft Dependency Injection (i.e., IServiceProvider)
The two ways to use this extension are described below. Both have the same result, but are different ways to pass in the logger.
using DbUp.Extensions.Logging;AddLoggerFromServiceProvider() on the UpgradeEngineBuilder passing IServiceProvider as an argument. Check the example below. DeployChanges.To
.SqlDatabase(con)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.AddLoggerFromServiceProvider(serviceProvider)
.Build();
using DbUp.Extensions.Logging;AddLogger() on the UpgradeEngineBuilder passing ILogger<UpgradeEngine> as an argument. Check the example below. DeployChanges.To
.SqlDatabase(con)
.WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly())
.AddLogger(logger)
.Build();