-
Notifications
You must be signed in to change notification settings - Fork 44
Migrate v2 = v3
Matteo Gregoricchio edited this page Apr 23, 2024
·
5 revisions
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.
Authorization filters - DI Registration
Namespaces migration ->