{"id":320809,"date":"2021-04-04T09:00:10","date_gmt":"2021-04-04T09:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320809"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2021-04-04T09:00:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320809","title":{"rendered":"\u0421\u0442\u0440\u0430\u0441\u0442\u0438 \u043f\u043e Serilog + .NET Core: \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/851\/a32\/509\/851a32509603eb81db2dc53197a55511.png\" width=\"1240\" height=\"693\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/serilog.net\/\" rel=\"noopener noreferrer nofollow\">Serilog<\/a> \u2014 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f .NET.&nbsp; \u0417\u0430\u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0435\u0449\u0451 \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b .NET Core, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u0441\u0432\u043e\u0451 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 2017 \u0433\u043e\u0434\u0443 Serilog \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core.  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Serilog \u0432 .NET Core&nbsp; \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u043a\u0430\u043a \u0438\u0445 \u0440\u0435\u0448\u0438\u0442\u044c?&nbsp;<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0433\u0440\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serilog&nbsp; \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Serilog \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u044f\u0432\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u043f\u0443\u0442\u0438 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0444\u0435\u0432\u0440\u0430\u043b\u0435 2013 \u0433\u043e\u0434\u0430 \u043d\u0430<a href=\"https:\/\/github.com\/\" rel=\"noopener noreferrer nofollow\"> github.com<\/a> \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 Opi, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0447\u0435\u0440\u0435\u0437 6 \u0434\u043d\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0435 \u0438\u043c\u044f<a href=\"https:\/\/github.com\/serilog\/serilog\" rel=\"noopener noreferrer nofollow\"> Serilog<\/a>. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e<a href=\"https:\/\/github.com\/serilog\/serilog\/blob\/f3c1c095aee587525dcf75e3d30494e0f9a70978\/src\/Serilog\/Serilog.csproj#L12\" rel=\"noopener noreferrer nofollow\"> \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0434 .NET Framework 4.5<\/a>. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 .NET \u043d\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0430 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e API \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u044b\u043b\u0438<a href=\"https:\/\/nlog-project.org\/\" rel=\"noopener noreferrer nofollow\"> NLog<\/a> \u0438<a href=\"http:\/\/logging.apache.org\/log4net\/\" rel=\"noopener noreferrer nofollow\"> log4net<\/a>.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/712\/fe4\/475\/712fe447545ca30053f2280478aa9ec1.png\" alt=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net \u0438 NLog 2012-2014 \u0433\u0433.\" title=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net \u0438 NLog 2012-2014 \u0433\u0433.\" width=\"1152\" height=\"398\"><figcaption>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net \u0438 NLog 2012-2014 \u0433\u0433.<\/figcaption><\/figure>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u043d\u0430 <a href=\"https:\/\/trends.google.ru\/trends\/explore?date=2012-01-01%202014-01-01&amp;q=%2Fg%2F12226rbp,log4net\" rel=\"noopener noreferrer nofollow\">google trends<\/a>.<\/p>\n<p>\u0415\u0449\u0451 \u0434\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 .NET Core (27.06.2016) \u0443\u0436\u0435 \u0448\u043b\u0438 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u044b \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (\u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<a href=\"https:\/\/github.com\/serilog\/serilog\/issues\/535\" rel=\"noopener noreferrer nofollow\"> \u0442\u0443\u0442<\/a>). \u0421\u0435\u0439\u0447\u0430\u0441 \u0443\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u0442\u0435\u0445 \u0432\u0440\u0435\u043c\u0451\u043d \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 .Net Core. \u042f\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2017, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430<a href=\"https:\/\/github.com\/\" rel=\"noopener noreferrer nofollow\"> github.com<\/a> \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\" rel=\"noopener noreferrer nofollow\"> serilog-aspnetcore<\/a>. \u041e\u043d \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\/blob\/d66061568c1cf4d4bb3150c766cb3747c707dbf7\/src\/Serilog.AspNetCore\/Serilog.AspNetCore.csproj#L7\" rel=\"noopener noreferrer nofollow\"> \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043f\u043e\u0434 .NET Standard 2.0<\/a>, \u0442.\u0435. \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 .NET Core 2.0.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 .NET Core, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serilog \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u042d\u0442\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Serilog \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 .NET Core, \u043a\u0430\u043a \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f API \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 .NET Core 3.1. \u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434 xUnit. \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Serilog:  <\/p>\n<ul>\n<li>\n<p>Serilog v2.10.0<a href=\"https:\/\/github.com\/serilog\/serilog.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog.git<\/a><\/p>\n<\/li>\n<li>\n<p>Serilog.AspNetCore v4.0.0<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog-aspnetcore.git<\/a><\/p>\n<\/li>\n<li>\n<p>Serilog.Extensions.Logging v3.0.1<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog-extensions-logging.git<\/a><\/p>\n<\/li>\n<li>\n<p>Serilog.Extensions.Hosting v4.1.1<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog-extensions-hosting.git<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Serilog + .NET Core<\/h2>\n<p> \u0412 100% \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u042f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c Serilog, \u044d\u0442\u043e \u0431\u044b\u043b \u043a\u043e\u0434 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0435\u0433\u043e<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\/blob\/v4.0.0\/samples\/Sample\/Program.cs\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">public static int Main(string[] args) {     Log.Logger = new LoggerConfiguration()         .WriteTo.Console()         .CreateBootstrapLogger();      Log.Information(\"Starting up!\");      try     {         CreateHostBuilder(args).Build().Run();          Log.Information(\"Stopped cleanly\");         return 0;     }     catch (Exception ex)     {         Log.Fatal(ex, \"An unhandled exception occured during bootstrapping\");         return 1;     }     finally     {         Log.CloseAndFlush();     } }  public static IHostBuilder CreateHostBuilder(string[] args) =&gt;     Host.CreateDefaultBuilder(args)     .UseSerilog((context, services, configuration) =&gt; configuration                 .ReadFrom.Configuration(context.Configuration)                 .ReadFrom.Services(services)                 .Enrich.FromLogContext()                 .WriteTo.Console())     .ConfigureWebHostDefaults(webBuilder =&gt; { webBuilder.UseStartup&lt;Startup&gt;(); });<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Serilog \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434 <code>Main<\/code>:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u042d\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0445\u043e\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0438 \u0444\u043b\u0430\u0448\u0438\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434 <code>CreateHostBuilder<\/code>:<\/p>\n<ul>\n<li>\n<p>\u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c Serilog, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0451\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422.\u0435. \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432 \u0438 \u043f\u0440\u043e \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0431\u0443\u0434\u0443\u0442 \u0443\u0436\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435 (\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.&nbsp;  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u044d\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c DI, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core, \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043b\u043e\u0433 \u0438 \u043e\u043d \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u043b\u043e\u0433\u0433\u0435\u0440 Serilog \u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>CreateHostBuilder<\/code>.<\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\/blob\/v4.0.0\/samples\/Sample\/Program.cs#L17\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Program.cs<\/a> \u043f\u0435\u0440\u0435\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430:  <\/p>\n<blockquote>\n<p>The initial \u00abbootstrap\u00bb logger is able to log errors during start-up. It&#8217;s completely replaced by the logger configured in <code>UseSerilog()<\/code> below, once configuration and dependency-injection have both been set up successfully.<\/p>\n<\/blockquote>\n<p>\u0422.\u0435. \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <code>UseSerilog()<\/code> \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 <code>HostBuilder <\/code>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0451\u043d \u043d\u0430 \u043b\u043e\u0433\u0433\u0435\u0440, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0432 Serilog &#8212;<a href=\"https:\/\/github.com\/serilog\/serilog\/blob\/v2.10.0\/src\/Serilog\/Log.cs#L49\" rel=\"noopener noreferrer nofollow\"> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Logger \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430&nbsp; Log<\/a> \u0441 get \u0438 set. \u0418\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430<a href=\"https:\/\/github.com\/serilog\/serilog\/blob\/v2.10.0\/src\/Serilog\/Core\/Pipeline\/SilentLogger.cs\" rel=\"noopener noreferrer nofollow\"> SilentLogger<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0438\u0448\u0435\u0442:<\/p>\n<pre><code class=\"cs\">public static class Log {     static ILogger _logger = SilentLogger.Instance;      \/\/\/ &lt;summary&gt;     \/\/\/ The globally-shared logger.     \/\/\/ &lt;\/summary&gt;     \/\/\/ &lt;exception cref=\"ArgumentNullException\"&gt;When &lt;paramref name=\"value\"\/&gt; is &lt;code&gt;null&lt;\/code&gt;&lt;\/exception&gt;     public static ILogger Logger     {         get =&gt; _logger;         set =&gt; _logger = value ?? throw new ArgumentNullException(nameof(value));     }     ... }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c <code>UseSerilog <\/code>\u0438 \u0433\u0434\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440.<\/p>\n<p>\u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L133\" rel=\"noopener noreferrer nofollow\"> UseSerilog<\/a> \u2014 \u044d\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0442\u0430\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L145\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442<\/a>, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u041d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u043a\u043e\u0434\u0430), \u0435\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u044b \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0442.\u0435. \u043e\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/Extensions\/Hosting\/ReloadableLogger.cs\" rel=\"noopener noreferrer nofollow\"> ReloadableLogger<\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger <\/code>(\u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 (\u0447\u0438\u0442\u0430\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439) \u043b\u043e\u0433\u0433\u0435\u0440) == <code>false<\/code>;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u00ab\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00bb \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440, \u0442\u043e \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L173\" rel=\"noopener noreferrer nofollow\"> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/a> \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L184\" rel=\"noopener noreferrer nofollow\"> \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043b\u0435\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 (\u0432\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger<\/code>), \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L205\" rel=\"noopener noreferrer nofollow\"> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u043b\u043e\u0433\u0433\u0435\u0440<\/a>, \u0435\u0441\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0418 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L211\" rel=\"noopener noreferrer nofollow\"> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/a> \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435, \u0430 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L214\" rel=\"noopener noreferrer nofollow\"> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f<\/a><a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L202\" rel=\"noopener noreferrer nofollow\"> null<\/a>, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>preserveStaticLogger==false,<\/code> \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:  <\/p>\n<ul>\n<li>\n<p>\u0432 \u0444\u0430\u0431\u0440\u0438\u043a\u0443 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432 Serilog<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L214\" rel=\"noopener noreferrer nofollow\"> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f<\/a> \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 (\u0442.\u0435. <code>null<\/code>). \u042d\u0442\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0432 .NET Core \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0444\u0430\u0431\u0440\u0438\u043a\u0435<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/8cca5d5000333c890d160f67bd4f4b645680c0c5\/src\/Serilog.Extensions.Hosting\/Extensions\/Hosting\/SerilogLoggerFactory.cs#L44\" rel=\"noopener noreferrer nofollow\"> \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432<\/a> Serilog \u0438 \u0442\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u0442\u043e\u0436\u0435 <code>null<\/code>. \u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/8cca5d5000333c890d160f67bd4f4b645680c0c5\/src\/Serilog.Extensions.Hosting\/Extensions\/Hosting\/SerilogLoggerFactory.cs#L64\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u043e\u0433\u0433\u0435\u0440\u0430<\/a>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>Microsoft.Extensions.Logging.ILogger<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 Serilog \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u0412 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440 Serilog , \u0442.\u0435. \u043e\u043f\u044f\u0442\u044c <code>null<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u043c \u043b\u043e\u0433\u0433\u0435\u0440\u0435 Serilog&nbsp; \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L37\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0431\u043e\u0440<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 Serilog : \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d <code>null<\/code>, \u0442\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 Serilog \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 <code>Log.Logger<\/code>. \u0418 \u0443\u0436\u0435 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L55\" rel=\"noopener noreferrer nofollow\"> \u043c\u0435\u0442\u043e\u0434\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a> \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 Serilog :<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L63\" rel=\"noopener noreferrer nofollow\"> \u0442\u0443\u0442<\/a> \u0438<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L125\" rel=\"noopener noreferrer nofollow\"> \u0442\u0443\u0442<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h2>\u042d\u0444\u0444\u0435\u043a\u0442 \u00ab\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432\u00bb<\/h2>\n<p><a class=\"anchor\" name=\"several-loggers\" id=\"several-loggers\"><\/a><\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Serilog \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e Serilog \u0432 .NET Core \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445:  <\/p>\n<ul>\n<li>\n<p>\u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e .NET Core \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Logger <\/code>\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>Serilog.Log<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 Serilog \u0432 .NET Core \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Serilog \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443:  <\/p>\n<ul>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 .NET Core (\u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u2014 <code>preserveStaticLogger==false<\/code>) \u2014 \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c), \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 .NET Core \u2014 \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<code>preserveStaticLogger==true<\/code>)<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u0432 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger<\/code>. \u0418 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u043e\u0433\u0438 \u2014 \u044d\u0442\u043e \u0442\u043e, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0435\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u0431\u0430\u0433\u0430\u043c\u0438, \u0442\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438.  <\/p>\n<p>\u041d\u043e \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger<\/code>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>false<\/code>. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0435\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u0440\u0438 \u043e\u0431\u043e\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u043b\u043e\u0433\u0433\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u044d\u0442\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445.  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u043e! \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/h4>\n<p>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0438\u0448\u0435\u0442 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 output \u043b\u043e\u0433-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441:  <\/p>\n<pre><code class=\"cs\">class TestLogger : Serilog.ILogger {     private readonly string _prefix;     private readonly ITestOutputHelper _output;      public TestLogger(string prefix, ITestOutputHelper output)     {     \t_prefix = prefix;     \t_output = output;     }     public void Write(LogEvent logEvent)     {     \t_output.WriteLine(_prefix + \" \" +  logEvent.MessageTemplate.Render(logEvent.Properties));     } }<\/code><\/pre>\n<h4>\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h4>\n<p>\u0412\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u044f\u043c\u043e \u0432 \u0442\u0435\u0441\u0442\u0435. \u041d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445:  <\/p>\n<pre><code class=\"cs\">class ConcurrentLoggingTestRequestSender {     private readonly WebApplicationFactory&lt;Startup&gt; _webAppFactory;     private readonly ITestOutputHelper _output;     private readonly string _logPrefix;      public ConcurrentLoggingTestRequestSender(WebApplicationFactory&lt;Startup&gt; webAppFactory, ITestOutputHelper output, string logPrefix)     {         _webAppFactory = webAppFactory;         _output = output;         _logPrefix = logPrefix;     }      public async Task&lt;HttpResponseMessage&gt; Send()     {         var client = _webAppFactory.WithWebHostBuilder(b =&gt; b.UseSerilog(         \t(context, config) =&gt; config         \t\t.WriteTo.Logger(new TestLogger(_logPrefix, _output))         )).CreateClient();          return await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, \"\/ping\"));     } }<\/code><\/pre>\n<p>\u0412 \u043c\u0435\u0442\u043e\u0434\u0435 Send \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Serilog \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440.<\/p>\n<h4>\u0422\u0435\u0441\u0442\u044b<\/h4>\n<p>\u0422\u0435\u0441\u0442\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b, \u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \u0432 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u043b\u043e\u0433-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445.  <\/p>\n<p>\u0422\u0435\u0441\u04421:<\/p>\n<pre><code class=\"cs\">public class ConcurrentLoggingTest_1of2 : IClassFixture&lt;WebApplicationFactory&lt;Startup&gt;&gt; {     private readonly ConcurrentLoggingTestRequestSender _requestSender;     private readonly ITestOutputHelper _output;      public ConcurrentLoggingTest_1of2(WebApplicationFactory&lt;Startup&gt; waf, ITestOutputHelper output)     {         _output = output;     \t_requestSender = new ConcurrentLoggingTestRequestSender(waf, output, \"==1==\");     }      [Fact]     public async Task Test()     {         _output.WriteLine(\"Test 1 of 2\");         _output.WriteLine(\"\");         var resp = await _requestSender.Send();          Assert.True(resp.IsSuccessStatusCode);     } }<\/code><\/pre>\n<p>\u0422\u0435\u0441\u04422:<\/p>\n<pre><code class=\"cs\">public class ConcurrentLoggingTest_2of2 : IClassFixture&lt;WebApplicationFactory&lt;Startup&gt;&gt; {     private readonly ConcurrentLoggingTestRequestSender _requestSender;     private readonly ITestOutputHelper _output;      public ConcurrentLoggingTest_2of2(WebApplicationFactory&lt;Startup&gt; waf, ITestOutputHelper output)     {         _output = output;     \t_requestSender = new ConcurrentLoggingTestRequestSender(waf, output, \"&gt;&gt;2&lt;&lt;\");     }      [Fact]     public async Task Test()     {         _output.WriteLine(\"Test 2 of 2\");         _output.WriteLine(\"\");         var resp = await _requestSender.Send();          Assert.True(resp.IsSuccessStatusCode);     } }<\/code><\/pre>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Test 1 of 2  ==1== Application started. Press Ctrl+C to shut down. ==1== Hosting environment: \"Development\" ==1== Content root path: \"C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke\" ==1== Request starting HTTP\/1.1 GET http:\/\/localhost\/ping   ==1== Executing endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' ==1== Route matched with \"{action = \\\"Ping\\\", controller = \\\"Ping\\\"}\". Executing controller action with signature \"Microsoft.AspNetCore.Mvc.IActionResult Ping()\" on controller \"SerilogPoke.Controllers.PingController\" (\"SerilogPoke\"). ==1== Executing ObjectResult, writing value of type '\"System.String\"'. ==1== Executed action \"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\" in 13.1068ms ==1== Executed endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' ==1== Request finished in 76.8507ms 200 text\/plain; charset=utf-8   Test 2 of 2  &gt;&gt;2&lt;&lt; Application started. Press Ctrl+C to shut down. &gt;&gt;2&lt;&lt; Hosting environment: \"Development\" &gt;&gt;2&lt;&lt; Content root path: \"C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke\" &gt;&gt;2&lt;&lt; Request starting HTTP\/1.1 GET http:\/\/localhost\/ping   &gt;&gt;2&lt;&lt; Executing endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' &gt;&gt;2&lt;&lt; Route matched with \"{action = \\\"Ping\\\", controller = \\\"Ping\\\"}\". Executing controller action with signature \"Microsoft.AspNetCore.Mvc.IActionResult Ping()\" on controller \"SerilogPoke.Controllers.PingController\" (\"SerilogPoke\"). &gt;&gt;2&lt;&lt; Executing ObjectResult, writing value of type '\"System.String\"'. &gt;&gt;2&lt;&lt; Executed action \"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\" in 15.2088ms &gt;&gt;2&lt;&lt; Executed endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' &gt;&gt;2&lt;&lt; Request finished in 78.8673ms 200 text\/plain; charset=utf-8<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u21161<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Test 1 of 2  Test 2 of 2  &gt;&gt;2&lt;&lt; Application started. Press Ctrl+C to shut down. &gt;&gt;2&lt;&lt; Application started. Press Ctrl+C to shut down. &gt;&gt;2&lt;&lt; Hosting environment: \"Development\" &gt;&gt;2&lt;&lt; Hosting environment: \"Development\" &gt;&gt;2&lt;&lt; Content root path: \"C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke\" &gt;&gt;2&lt;&lt; Content root path: \"C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke\" &gt;&gt;2&lt;&lt; Request starting HTTP\/1.1 GET http:\/\/localhost\/ping   &gt;&gt;2&lt;&lt; Request starting HTTP\/1.1 GET http:\/\/localhost\/ping   &gt;&gt;2&lt;&lt; Executing endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' &gt;&gt;2&lt;&lt; Executing endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' &gt;&gt;2&lt;&lt; Route matched with \"{action = \\\"Ping\\\", controller = \\\"Ping\\\"}\". Executing controller action with signature \"Microsoft.AspNetCore.Mvc.IActionResult Ping()\" on controller \"SerilogPoke.Controllers.PingController\" (\"SerilogPoke\"). &gt;&gt;2&lt;&lt; Route matched with \"{action = \\\"Ping\\\", controller = \\\"Ping\\\"}\". Executing controller action with signature \"Microsoft.AspNetCore.Mvc.IActionResult Ping()\" on controller \"SerilogPoke.Controllers.PingController\" (\"SerilogPoke\"). &gt;&gt;2&lt;&lt; Executing ObjectResult, writing value of type '\"System.String\"'. &gt;&gt;2&lt;&lt; Executing ObjectResult, writing value of type '\"System.String\"'. &gt;&gt;2&lt;&lt; Executed action \"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\" in 13.5891ms &gt;&gt;2&lt;&lt; Executed action \"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\" in 13.5891ms &gt;&gt;2&lt;&lt; Executed endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' &gt;&gt;2&lt;&lt; Executed endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' &gt;&gt;2&lt;&lt; Request finished in 78.0903ms 200 text\/plain; charset=utf-8 &gt;&gt;2&lt;&lt; Request finished in 78.0958ms 200 text\/plain; charset=utf-8<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u21162<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Test 1 of 2  ==1== Application started. Press Ctrl+C to shut down. ==1== Application started. Press Ctrl+C to shut down. ==1== Hosting environment: \"Development\" ==1== Hosting environment: \"Development\" ==1== Content root path: \"C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke\" ==1== Content root path: \"C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke\" ==1== Request starting HTTP\/1.1 GET http:\/\/localhost\/ping   ==1== Request starting HTTP\/1.1 GET http:\/\/localhost\/ping   ==1== Executing endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' ==1== Executing endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' ==1== Route matched with \"{action = \\\"Ping\\\", controller = \\\"Ping\\\"}\". Executing controller action with signature \"Microsoft.AspNetCore.Mvc.IActionResult Ping()\" on controller \"SerilogPoke.Controllers.PingController\" (\"SerilogPoke\"). ==1== Route matched with \"{action = \\\"Ping\\\", controller = \\\"Ping\\\"}\". Executing controller action with signature \"Microsoft.AspNetCore.Mvc.IActionResult Ping()\" on controller \"SerilogPoke.Controllers.PingController\" (\"SerilogPoke\"). ==1== Executing ObjectResult, writing value of type '\"System.String\"'. ==1== Executing ObjectResult, writing value of type '\"System.String\"'. ==1== Executed action \"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\" in 12.7648ms ==1== Executed action \"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\" in 12.7649ms ==1== Executed endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' ==1== Executed endpoint '\"SerilogPoke.Controllers.PingController.Ping (SerilogPoke)\"' ==1== Request finished in 78.428ms 200 text\/plain; charset=utf-8 ==1== Request finished in 78.4282ms 200 text\/plain; charset=utf-8  Test 2 of 2 <\/code><\/pre>\n<\/div>\n<\/details>\n<h4>\u0412\u044b\u0432\u043e\u0434 \u043f\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/h4>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043b\u043e\u0433\u0433\u0435\u0440 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u043e\u0434\u0438\u043d \u043d\u0430 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b, \u0430 \u0442\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0435\u0441\u0442\u0435, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u0442 \u043b\u043e\u0433\u0433\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u043e\u043b\u044e <code>Serilog.Log.Logger<\/code> \u043f\u043e\u0437\u0436\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0434\u0432\u0438\u0433 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c, \u0442\u043e \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430\u0434\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Serilog \u0432 .NET Core (\u043c\u0435\u0442\u043e\u0434 <code>UseSerilog()<\/code>)&nbsp; \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger = true<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0438 \u0441\u0432\u043e\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u00ab<a href=\"#several-loggers\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432<\/a>\u00bb \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438.<\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u0433\u0434\u0435 \u043d\u0443\u0436\u0435\u043d?<\/h2>\n<p>\u041f\u0440\u0438 \u0434\u043e\u043b\u0436\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435, \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c DI \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 .NET Core, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0445\u043e\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>CreateHostBuilder<\/code>. \u0418 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Serilog\u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u0430\u043c \u0442\u0430\u043a \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u043d\u0435\u0442 DI \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b .NET Core \u2014 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 Main \u0432\u043d\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0445\u043e\u0441\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a!<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a!<\/h4>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u0435\u0449\u0451 \u043d\u0435 \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0437\u0436\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u043e\u043c. \u0421\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e <code>Console <\/code>\u0438 <code>Debug<\/code>. \u041e\u043d\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0435\u0433\u043e \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u0434\u0435. \u042d\u0442\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u044b \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u0438 \u0442\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f:  <\/p>\n<ul>\n<li>\n<p>\u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p><code>Debug <\/code>\u2014 \u043d\u0443, \u044d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e IDE \u0438 \u0442\u0443\u0442 \u0442\u043e\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p> \u0412\u043e\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e:  <\/p>\n<ul>\n<li>\n<p>\u044d\u0442\u043e \u043d\u0435 \u0434\u0430\u0451\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u043e \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 (\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0445\u043e\u0441\u0442\u0430, \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435);<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0445\u043e\u0441\u0442\u0430 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0445\u043e\u0441\u0442 \u0441\u0430\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435:<\/p>\n<\/li>\n<\/ul>\n<pre><code>[01:53:06 INF] Now listening on: http:\/\/localhost:5000 [01:53:06 INF] Application started. Press Ctrl+C to shut down. [01:53:06 INF] Hosting environment: Development [01:53:06 INF] Content root path: C:\\Users\\ozzye\\Documents\\prog\\my\\serilog-poke\\src\\SerilogPoke<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434: <\/p>\n<blockquote>\n<p>\u044d\u0442\u043e \u043b\u043e\u0433-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u043b\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435<\/p>\n<\/blockquote>\n<h4>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 &#8212; \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c?<\/h4>\n<p>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c.  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u043f\u0430\u0440\u0443 \u0442\u0435\u0441\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432\u044b\u043a\u0438\u043d\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<pre><code class=\"cs\">public class Startup {     public void ConfigureServices(IServiceCollection services)     {         throw new Exception(\"Ololo!\");          services.AddControllers();     } }<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/618\/dcd\/3c6\/618dcd3c6466ab72c3ebbd8b75b0ae4d.png\" alt=\"\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0438 \u043e\u0442\u043b\u043e\u0432\u0435 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \" title=\"\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0438 \u043e\u0442\u043b\u043e\u0432\u0435 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \" width=\"960\" height=\"375\"><figcaption>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0438 \u043e\u0442\u043b\u043e\u0432\u0435 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 Main:<\/p>\n<pre><code class=\"cs\">public static int Main(string[] args) {     Log.Logger = new LoggerConfiguration()         .WriteTo.Console()         .CreateBootstrapLogger();      Log.Information(\"Starting up!\");      try     {         CreateHostBuilder(args).Build().Run();          Log.Information(\"Stopped cleanly\");         return 0;     }     \/\/catch (Exception ex)     \/\/{     \/\/    Log.Fatal(ex, \"An unhandled exception occured during bootstrapping\");     \/\/    return 1;     \/\/}     finally     {         Log.CloseAndFlush();     } }<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dba\/80d\/df0\/dba80ddf0cdca94c3caef2954a52ee1b.png\" alt=\"\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0435\u0437 \u043e\u0442\u043b\u043e\u0432\u0430 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438\" title=\"\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0435\u0437 \u043e\u0442\u043b\u043e\u0432\u0430 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438\" width=\"960\" height=\"360\"><figcaption>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0435\u0437 \u043e\u0442\u043b\u043e\u0432\u0430 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438<\/figcaption><\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434: <\/p>\n<blockquote>\n<p>\u0414\u0430\u0436\u0435 \u0431\u0435\u0437 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Serilog, \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<\/blockquote>\n<h4>\u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 &#8212; \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f?<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u0442\u0435\u0441\u0442\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0435\u0440\u043d\u0451\u043c \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 <code>try-catch<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 Serilog, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f&nbsp; \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c <code>initial<\/code>, \u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c <code>configured<\/code>.<\/p>\n<p>\u0422\u0435\u0441\u04421: \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"cs\">\/\/Arrange var initialLogger = new TestLogger(\"initial: \", _output); var configuredLogger = new TestLogger(\"configured: \", _output); HttpClient client;  Log.Logger = initialLogger;  Log.Information(\"Starting up!\");  try {     client = _waf.WithWebHostBuilder(         builder =&gt; builder         \t.UseSerilog((context, config) =&gt; config                     .WriteTo.Logger(configuredLogger))         \t.ConfigureServices(collection =&gt;                            {                                throw new Exception(\"Ololo!\");                            })     ).CreateClient(); } catch (Exception e) {     Log.Fatal(e, \"An unhandled exception occured during bootstrapping\");     throw; } finally {     Log.CloseAndFlush(); }  \/\/Act var resp = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, \"\/ping\"));  \/\/Assert Assert.True(resp.IsSuccessStatusCode);<\/code><\/pre>\n<p>\u041b\u043e\u0433:  <\/p>\n<pre><code>initial:  Starting up! configured:  An unhandled exception occured during bootstrapping<\/code><\/pre>\n<p>\u0422\u0435\u0441\u04422: \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<pre><code class=\"cs\">\/\/Arrange var initialLogger = new TestLogger(\"initial: \", _output); var configuredLogger = new TestLogger(\"configured: \", _output); HttpClient client;  Log.Logger = initialLogger;  Log.Information(\"Starting up!\");  try {     client = _waf.WithWebHostBuilder(         builder =&gt; builder         \t.UseSerilog((context, config) =&gt;                          \tconfig.WriteTo.Logger(configuredLogger)                        )         \t.ConfigureAppConfiguration((context, configurationBuilder) =&gt; \t\t                             configurationBuilder.AddJsonFile(\"absent.json\"))                     \t)             .CreateClient(); } catch (Exception e) {     Log.Fatal(e, \"An unhandled exception occured during bootstrapping\");      throw; } finally {     Log.CloseAndFlush(); }  \/\/Act var resp = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, \"\/ping\"));  \/\/Assert Assert.True(resp.IsSuccessStatusCode);<\/code><\/pre>\n<p>\u041b\u043e\u0433:<\/p>\n<pre><code>initial:  Starting up! initial:  An unhandled exception occured during bootstrapping<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<blockquote>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u0435\u0441\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u043b\u043e\u0433 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u0430\u043c\u0438:&nbsp; \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u043c (\u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c) \u0438\u043b\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0430\u0445 (\u043d\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438) \u043c\u043e\u0436\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0434\u043e \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u0422.\u0435. \u0442\u043e \u043b\u0438 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u043b\u0438 \u043d\u0435\u0442. \u0410 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043b\u043e\u0433\u0433\u0435\u0440.  <\/p>\n<\/blockquote>\n<h4>\u0423\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435<\/h4>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u0434\u043e \u0444\u0430\u043a\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u043b\u043e\u0433\u0433\u0435\u0440\u0443 \u0441 \u0446\u0435\u043b\u044c\u044e \u0435\u0433\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0432 \u0431\u043b\u043e\u043a\u0435 <code>finally<\/code>:  <\/p>\n<pre><code class=\"cs\">public static int Main(string[] args) {     ...     try     {         CreateHostBuilder(args).Build().Run();          Log.Information(\"Stopped cleanly\");         return 0;     }     catch (Exception ex)     {         ...     }     finally     {         Log.CloseAndFlush();     } }<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434:<\/p>\n<blockquote>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.  <\/p>\n<\/blockquote>\n<h4>\u0412\u044b\u0432\u043e\u0434 \u043f\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0432 Main<\/h4>\n<p>\u041b\u043e\u0433-\u0437\u0430\u043f\u0438\u0441\u0438 \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0437\u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u043a\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0438 \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430.  <\/p>\n<p>\u041f\u043e \u043e\u043f\u044b\u0442\u0443, \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0440\u0435\u0434\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u044b\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0430\u043c\u044b\u0435, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u0442 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u044b, \u0432\u0435\u0441\u044c\u043c\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u043e\u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u043b\u043e\u0433\u0433\u0435\u0440, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0430 \u043e\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f.  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u0435\u043b\u0430\u044e \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445 \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Serilog \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0430 \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u043a-\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0432 .NET Core \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Serilog.<\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u0412\u0440\u0435\u0434<\/h2>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 Serilog, \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>Logger <\/code>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>Serilog.Log<\/code>. \u042d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0445\u043e\u0441\u0442\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u044d\u0442\u043e \u043d\u0435 Singleton \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u043e \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u043d \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0442\u0435\u0440\u044f \u043b\u043e\u0433-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Serilog \u0432 .NET Core (\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger <\/code>\u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>UseSerilog()<\/code>) \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0441 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u044d\u0444\u0444\u0435\u043a\u0442 \u00ab<a href=\"#several-loggers\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432<\/a>\u00bb<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core \u0438 Serilog<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>Serilog.Log.Logger<\/code> \u043c\u0438\u043c\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b DI \u043e\u0442 .NET Core, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0441\u0430\u043c\u044b\u043c\u0438 \u0432\u0435\u0441\u043e\u043c\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0433\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u00ab\u044d\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u00ab\u0430 \u043d\u0443 \u0447\u0451, \u0438 \u0442\u0430\u043a \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u00ab\u042f \u0442\u0430\u043a \u043f\u0440\u0438\u0432\u044b\u043a \u043d\u0430 .NET Framework\u00bb;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441-\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 &#8212;<a href=\"https:\/\/blog.ploeh.dk\/2010\/02\/03\/ServiceLocatorisanAnti-Pattern\/\" rel=\"noopener noreferrer nofollow\"> \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d<\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0442.\u043a. \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Logger <\/code>\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u0441\u0430\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u044b \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0432 \u043d\u0435\u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f .NET Core. \u0421\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442<a href=\"https:\/\/medium.com\/@leprosus\/%D1%81%D0%B0%D0%BC%D1%8B%D0%B5-%D1%85%D0%BE%D0%B4%D0%BE%D0%B2%D1%8B%D0%B5-%D0%B0%D0%BD%D1%82%D0%B8-%D0%BF%D0%B0%D1%82%D1%82%D0%B5%D1%80%D0%BD%D1%8B-8077d1f93#cabb\" rel=\"noopener noreferrer nofollow\"> \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d Boat Anchor<\/a> .<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a9b\/a82\/f62\/a9ba82f620e36e5ed992b0cc0e3783f6.png\" alt=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net, NLog \u0438 Serilog 2013-2021 \u0433\u0433.\" title=\"\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net, NLog \u0438 Serilog 2013-2021 \u0433\u0433.\" width=\"1152\" height=\"394\"><figcaption>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net, NLog \u0438 Serilog 2013-2021 \u0433\u0433.<\/figcaption><\/figure>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u043d\u0430 <a href=\"https:\/\/trends.google.ru\/trends\/explore?date=2013-01-01%202021-01-04&amp;q=%2Fg%2F12226rbp,log4net,serilog\" rel=\"noopener noreferrer nofollow\">google trends<\/a>.<\/p>\n<p>Serilog \u0431\u044b\u043b \u0438 \u0435\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041d\u043e \u043e\u043d \u043d\u0435 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f .NET Core, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043d\u0451\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430 .NET Framework.&nbsp; \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441, .NET, \u0432 \u0432\u0438\u0434\u0435 .NET 5, \u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u0432\u0437\u044f\u0442\u043e\u0439 \u0438\u0437 .NET Core.&nbsp; \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Serilog \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u043e\u0442\u043d\u043e.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0432 github \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c \u043b\u043e\u0433\u043e\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u0440\u0435\u0448\u0438\u0442\u044c. \u0422\u0443\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serilog \u0432\u0441\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b,&nbsp; \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a .NET Framework \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u0438\u0438<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\" rel=\"noopener noreferrer nofollow\"> serilog-aspnetcore<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0418 \u0442\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u0442.\u0447. \u043a\u043b\u0430\u0441\u0441 Serilog.Log. \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 Serilog \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u043d\u0430 .NET Core \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d;<\/p>\n<\/li>\n<li>\n<p>\u0432 serilog-aspnetcore \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Serilog \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u043e\u043c\u0443 \u0441\u043b\u0443\u0447\u0430\u044e, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0445. \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger = true<\/code>, \u0442.\u0435. \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 Serilog \u0432 .NET Core \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438.  <\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Serilog \u0432 .NET Core.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/550582\/\"> https:\/\/habr.com\/ru\/post\/550582\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/serilog.net\/\" rel=\"noopener noreferrer nofollow\">Serilog<\/a> \u2014 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f .NET.&nbsp; \u0417\u0430\u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0435\u0449\u0451 \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b .NET Core, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u0441\u0432\u043e\u0451 \u0432\u0438\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 2017 \u0433\u043e\u0434\u0443 Serilog \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core.  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Serilog \u0432 .NET Core&nbsp; \u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u043a\u0430\u043a \u0438\u0445 \u0440\u0435\u0448\u0438\u0442\u044c?&nbsp;<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0433\u0440\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serilog&nbsp; \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Serilog \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u044f\u0432\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u043f\u0443\u0442\u0438 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0444\u0435\u0432\u0440\u0430\u043b\u0435 2013 \u0433\u043e\u0434\u0430 \u043d\u0430<a href=\"https:\/\/github.com\/\" rel=\"noopener noreferrer nofollow\"> github.com<\/a> \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 Opi, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0447\u0435\u0440\u0435\u0437 6 \u0434\u043d\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0435 \u0438\u043c\u044f<a href=\"https:\/\/github.com\/serilog\/serilog\" rel=\"noopener noreferrer nofollow\"> Serilog<\/a>. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e<a href=\"https:\/\/github.com\/serilog\/serilog\/blob\/f3c1c095aee587525dcf75e3d30494e0f9a70978\/src\/Serilog\/Serilog.csproj#L12\" rel=\"noopener noreferrer nofollow\"> \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0434 .NET Framework 4.5<\/a>. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 .NET \u043d\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0430 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e API \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0430\u043c\u044b\u043c\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u044b\u043b\u0438<a href=\"https:\/\/nlog-project.org\/\" rel=\"noopener noreferrer nofollow\"> NLog<\/a> \u0438<a href=\"http:\/\/logging.apache.org\/log4net\/\" rel=\"noopener noreferrer nofollow\"> log4net<\/a>.  <\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 log4net \u0438 NLog 2012-2014 \u0433\u0433.<\/figcaption><\/figure>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u043d\u0430 <a href=\"https:\/\/trends.google.ru\/trends\/explore?date=2012-01-01%202014-01-01&amp;q=%2Fg%2F12226rbp,log4net\" rel=\"noopener noreferrer nofollow\">google trends<\/a>.<\/p>\n<p>\u0415\u0449\u0451 \u0434\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 .NET Core (27.06.2016) \u0443\u0436\u0435 \u0448\u043b\u0438 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u044b \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (\u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<a href=\"https:\/\/github.com\/serilog\/serilog\/issues\/535\" rel=\"noopener noreferrer nofollow\"> \u0442\u0443\u0442<\/a>). \u0421\u0435\u0439\u0447\u0430\u0441 \u0443\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445 \u0442\u0435\u0445 \u0432\u0440\u0435\u043c\u0451\u043d \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 .Net Core. \u042f\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0430\u0432\u0433\u0443\u0441\u0442\u0435 2017, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430<a href=\"https:\/\/github.com\/\" rel=\"noopener noreferrer nofollow\"> github.com<\/a> \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\" rel=\"noopener noreferrer nofollow\"> serilog-aspnetcore<\/a>. \u041e\u043d \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\/blob\/d66061568c1cf4d4bb3150c766cb3747c707dbf7\/src\/Serilog.AspNetCore\/Serilog.AspNetCore.csproj#L7\" rel=\"noopener noreferrer nofollow\"> \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043f\u043e\u0434 .NET Standard 2.0<\/a>, \u0442.\u0435. \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 .NET Core 2.0.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 .NET Core, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serilog \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u042d\u0442\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Serilog \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 .NET Core, \u043a\u0430\u043a \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f API \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 .NET Core 3.1. \u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434 xUnit. \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a Serilog:  <\/p>\n<ul>\n<li>\n<p>Serilog v2.10.0<a href=\"https:\/\/github.com\/serilog\/serilog.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog.git<\/a><\/p>\n<\/li>\n<li>\n<p>Serilog.AspNetCore v4.0.0<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog-aspnetcore.git<\/a><\/p>\n<\/li>\n<li>\n<p>Serilog.Extensions.Logging v3.0.1<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog-extensions-logging.git<\/a><\/p>\n<\/li>\n<li>\n<p>Serilog.Extensions.Hosting v4.1.1<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting.git\" rel=\"noopener noreferrer nofollow\"> https:\/\/github.com\/serilog\/serilog-extensions-hosting.git<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Serilog + .NET Core<\/h2>\n<p> \u0412 100% \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u042f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c Serilog, \u044d\u0442\u043e \u0431\u044b\u043b \u043a\u043e\u0434 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0435\u0433\u043e<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\/blob\/v4.0.0\/samples\/Sample\/Program.cs\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">public static int Main(string[] args) {     Log.Logger = new LoggerConfiguration()         .WriteTo.Console()         .CreateBootstrapLogger();      Log.Information(\"Starting up!\");      try     {         CreateHostBuilder(args).Build().Run();          Log.Information(\"Stopped cleanly\");         return 0;     }     catch (Exception ex)     {         Log.Fatal(ex, \"An unhandled exception occured during bootstrapping\");         return 1;     }     finally     {         Log.CloseAndFlush();     } }  public static IHostBuilder CreateHostBuilder(string[] args) =&gt;     Host.CreateDefaultBuilder(args)     .UseSerilog((context, services, configuration) =&gt; configuration                 .ReadFrom.Configuration(context.Configuration)                 .ReadFrom.Services(services)                 .Enrich.FromLogContext()                 .WriteTo.Console())     .ConfigureWebHostDefaults(webBuilder =&gt; { webBuilder.UseStartup&lt;Startup&gt;(); });<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Serilog \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434 <code>Main<\/code>:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u042d\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0445\u043e\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0438 \u0444\u043b\u0430\u0448\u0438\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043c\u0435\u0442\u043e\u0434 <code>CreateHostBuilder<\/code>:<\/p>\n<ul>\n<li>\n<p>\u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c Serilog, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0451\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422.\u0435. \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432 \u0438 \u043f\u0440\u043e \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0431\u0443\u0434\u0443\u0442 \u0443\u0436\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435 (\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.&nbsp;  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u044d\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c DI, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core, \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043b\u043e\u0433 \u0438 \u043e\u043d \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u043b\u043e\u0433\u0433\u0435\u0440 Serilog \u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>CreateHostBuilder<\/code>.<\/p>\n<h2>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>\u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432<a href=\"https:\/\/github.com\/serilog\/serilog-aspnetcore\/blob\/v4.0.0\/samples\/Sample\/Program.cs#L17\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Program.cs<\/a> \u043f\u0435\u0440\u0435\u0434 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430:  <\/p>\n<blockquote>\n<p>The initial \u00abbootstrap\u00bb logger is able to log errors during start-up. It&#8217;s completely replaced by the logger configured in <code>UseSerilog()<\/code> below, once configuration and dependency-injection have both been set up successfully.<\/p>\n<\/blockquote>\n<p>\u0422.\u0435. \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <code>UseSerilog()<\/code> \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 <code>HostBuilder <\/code>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0451\u043d \u043d\u0430 \u043b\u043e\u0433\u0433\u0435\u0440, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0432 Serilog &#8212;<a href=\"https:\/\/github.com\/serilog\/serilog\/blob\/v2.10.0\/src\/Serilog\/Log.cs#L49\" rel=\"noopener noreferrer nofollow\"> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Logger \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430&nbsp; Log<\/a> \u0441 get \u0438 set. \u0418\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430<a href=\"https:\/\/github.com\/serilog\/serilog\/blob\/v2.10.0\/src\/Serilog\/Core\/Pipeline\/SilentLogger.cs\" rel=\"noopener noreferrer nofollow\"> SilentLogger<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u043f\u0438\u0448\u0435\u0442:<\/p>\n<pre><code class=\"cs\">public static class Log {     static ILogger _logger = SilentLogger.Instance;      \/\/\/ &lt;summary&gt;     \/\/\/ The globally-shared logger.     \/\/\/ &lt;\/summary&gt;     \/\/\/ &lt;exception cref=\"ArgumentNullException\"&gt;When &lt;paramref name=\"value\"\/&gt; is &lt;code&gt;null&lt;\/code&gt;&lt;\/exception&gt;     public static ILogger Logger     {         get =&gt; _logger;         set =&gt; _logger = value ?? throw new ArgumentNullException(nameof(value));     }     ... }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c <code>UseSerilog <\/code>\u0438 \u0433\u0434\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440.<\/p>\n<p>\u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L133\" rel=\"noopener noreferrer nofollow\"> UseSerilog<\/a> \u2014 \u044d\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0442\u0430\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L145\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442<\/a>, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u041d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u043a\u043e\u0434\u0430), \u0435\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u044b \u0432\u0441\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0442.\u0435. \u043e\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/Extensions\/Hosting\/ReloadableLogger.cs\" rel=\"noopener noreferrer nofollow\"> ReloadableLogger<\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger <\/code>(\u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 (\u0447\u0438\u0442\u0430\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439) \u043b\u043e\u0433\u0433\u0435\u0440) == <code>false<\/code>;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u00ab\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00bb \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440, \u0442\u043e \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L173\" rel=\"noopener noreferrer nofollow\"> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/a> \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L184\" rel=\"noopener noreferrer nofollow\"> \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/a>;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043b\u0435\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 (\u0432\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger<\/code>), \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L205\" rel=\"noopener noreferrer nofollow\"> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u043b\u043e\u0433\u0433\u0435\u0440<\/a>, \u0435\u0441\u043b\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0418 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L211\" rel=\"noopener noreferrer nofollow\"> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440<\/a> \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435, \u0430 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L214\" rel=\"noopener noreferrer nofollow\"> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f<\/a><a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L202\" rel=\"noopener noreferrer nofollow\"> null<\/a>, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>preserveStaticLogger==false,<\/code> \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:  <\/p>\n<ul>\n<li>\n<p>\u0432 \u0444\u0430\u0431\u0440\u0438\u043a\u0443 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432 Serilog<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/v4.1.1\/src\/Serilog.Extensions.Hosting\/SerilogHostBuilderExtensions.cs#L214\" rel=\"noopener noreferrer nofollow\"> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f<\/a> \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 (\u0442.\u0435. <code>null<\/code>). \u042d\u0442\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0432 .NET Core \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0444\u0430\u0431\u0440\u0438\u043a\u0435<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/8cca5d5000333c890d160f67bd4f4b645680c0c5\/src\/Serilog.Extensions.Hosting\/Extensions\/Hosting\/SerilogLoggerFactory.cs#L44\" rel=\"noopener noreferrer nofollow\"> \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432<\/a> Serilog \u0438 \u0442\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440 \u2014 \u0442\u043e\u0436\u0435 <code>null<\/code>. \u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-hosting\/blob\/8cca5d5000333c890d160f67bd4f4b645680c0c5\/src\/Serilog.Extensions.Hosting\/Extensions\/Hosting\/SerilogLoggerFactory.cs#L64\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u043e\u0433\u0433\u0435\u0440\u0430<\/a>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <code>Microsoft.Extensions.Logging.ILogger<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 Serilog \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f .NET Core. \u0412 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043b\u043e\u0433\u0433\u0435\u0440 Serilog , \u0442.\u0435. \u043e\u043f\u044f\u0442\u044c <code>null<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u043c \u043b\u043e\u0433\u0433\u0435\u0440\u0435 Serilog&nbsp; \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L37\" rel=\"noopener noreferrer nofollow\"> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0431\u043e\u0440<\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 Serilog : \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d <code>null<\/code>, \u0442\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 Serilog \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0438\u0437 <code>Log.Logger<\/code>. \u0418 \u0443\u0436\u0435 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L55\" rel=\"noopener noreferrer nofollow\"> \u043c\u0435\u0442\u043e\u0434\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a> \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 Serilog :<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L63\" rel=\"noopener noreferrer nofollow\"> \u0442\u0443\u0442<\/a> \u0438<a href=\"https:\/\/github.com\/serilog\/serilog-extensions-logging\/blob\/60bcdd91bcb629a62b5f9db405631f03b8da417c\/src\/Serilog.Extensions.Logging\/Extensions\/Logging\/SerilogLogger.cs#L125\" rel=\"noopener noreferrer nofollow\"> \u0442\u0443\u0442<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h2>\u042d\u0444\u0444\u0435\u043a\u0442 \u00ab\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432\u00bb<\/h2>\n<p><a class=\"anchor\" name=\"several-loggers\" id=\"several-loggers\"><\/a><\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Serilog \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e Serilog \u0432 .NET Core \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445:  <\/p>\n<ul>\n<li>\n<p>\u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e .NET Core \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>Logger <\/code>\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>Serilog.Log<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 Serilog \u0432 .NET Core \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Serilog \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443:  <\/p>\n<ul>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 .NET Core (\u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u2014 <code>preserveStaticLogger==false<\/code>) \u2014 \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 \u0447\u0435\u0440\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c), \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 .NET Core \u2014 \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<code>preserveStaticLogger==true<\/code>)<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u0432 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger<\/code>. \u0418 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u043e\u0433\u0438 \u2014 \u044d\u0442\u043e \u0442\u043e, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0435\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u0431\u0430\u0433\u0430\u043c\u0438, \u0442\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438.  <\/p>\n<p>\u041d\u043e \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>preserveStaticLogger<\/code>\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>false<\/code>. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0435\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u043b\u043e\u0433\u0433\u0435\u0440 \u043f\u0440\u0438 \u043e\u0431\u043e\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/h2>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0433\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320809","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320809"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320809\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}