-
Notifications
You must be signed in to change notification settings - Fork 42
Migrate v2 = v3
v3 changed many namespaces to their correct repository folders structure.
If you find your old methods not imported, please import correct namespaces (majority will be either under [Serilog.UI.{Provider}.Extensions] or Serilog.UI.Core.{Folder}).
All available providers can be registered in Serilog UI with an Use[...] extension method, exposed on ISerilogUiOptionsBuilder.
In v2, each provider exposed a number of parameters directly on its extension method:
// example: mssql provider
services.AddSerilogUi(options => options.UseSqlServer(param1, param2, param3));
In v3, to prevent these methods from adding too many parameters and to prepare for future developments, the registration MUST be migrated to fluent interfaces. Each Use[...] method now exposes an Action, that the user can use to set the configuration data.
// example: mssql provider
services.AddSerilogUi(options =>
options.UseSqlServer(options => options
.WithConnectionString("example")
.WithTable("table")
));
For the complete list of providers API, please check this page.
UiOptions can now be configured only with fluent interface methods.
Move old configurations to fluent interface (all details here).
Authorization filters are now registered through Dependency Injection.
Move the creation of filters (new Filter(...)) to using extensions methods on IServiceProvider. All nfo can be found here.