该文章是系列文章 基于.NetCore和ABP框架如何让Windows服务执行Quartz定时作业 的其中一篇。

问题

ABP.WindowsService/Demo.MyJob/4.0.0该项目不仅包含了Job服务,还有一个Abp项目自动生成的web站点服务。之前改造了job的日志记录,之后尝试改造web站点。发现一个问题,就是每次启动都会生成类似下文的日志,但是这些日志都不是我主动记录的日志。那么显然,当你试图记录日志,下面的这些框架自动生成的诊断日志就会成为干扰。如何去除这些诊断日志呢?

DEBUG 2019-09-03 18:51:28,556 [1    ] Abp.Modules.AbpModuleManager             - Loading Abp modules...
DEBUG 2019-09-03 18:51:28,928 [1 ] Abp.Modules.AbpModuleManager - Found 10 ABP modules in total.
DEBUG 2019-09-03 18:51:29,700 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.Web.Startup.MyJobWebModule, Demo.MyJob.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,704 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.MyJobApplicationModule, Demo.MyJob.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,705 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.MyJobCoreModule, Demo.MyJob.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,707 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AutoMapper.AbpAutoMapperModule, Abp.AutoMapper, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,707 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AbpKernelModule, Abp, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,707 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.EntityFrameworkCore.MyJobEntityFrameworkCoreModule, Demo.MyJob.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,707 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule, Abp.EntityFrameworkCore, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,708 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkCommonModule, Abp.EntityFramework.Common, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,708 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetCore.AbpAspNetCoreModule, Abp.AspNetCore, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,708 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebCommonModule, Abp.Web.Common, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:29,711 [1 ] Abp.Modules.AbpModuleManager - 10 modules loaded.
DEBUG 2019-09-03 18:51:30,517 [1 ] ameworkCore.AbpEntityFrameworkCoreModule - Registering DbContext: Demo.MyJob.EntityFrameworkCore.MyJobDbContext, Demo.MyJob.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 18:51:30,912 [1 ] Abp.Localization.LocalizationManager - Initializing 3 localization sources.
DEBUG 2019-09-03 18:51:31,069 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp
DEBUG 2019-09-03 18:51:31,372 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: MyJob
DEBUG 2019-09-03 18:51:31,419 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb
DEBUG 2019-09-03 18:51:31,944 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Castle.Proxies.BackgroundJobManagerProxy
DEBUG 2019-09-03 18:51:32,019 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 0 classes define auto mapping attributes
INFO 2019-09-03 18:51:33,581 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/
INFO 2019-09-03 18:51:33,581 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 DEBUG http://localhost:62114/ 0
INFO 2019-09-03 18:51:33,673 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 90.7012ms 200
INFO 2019-09-03 18:51:34,194 [7 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Demo.MyJob.Web.Controllers.HomeController.Index (Demo.MyJob.Web)
INFO 2019-09-03 18:51:34,292 [7 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Demo.MyJob.Web.Controllers.HomeController.Index (Demo.MyJob.Web) - Validation state: Valid
INFO 2019-09-03 18:51:34,300 [7 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Demo.MyJob.Web.Controllers.HomeController.Index (Demo.MyJob.Web), returned result Microsoft.AspNetCore.Mvc.ViewResult in 5.1007ms.
INFO 2019-09-03 18:51:34,318 [7 ] Abp.Auditing.SimpleLogAuditingStore - AUDIT LOG: Demo.MyJob.Web.Controllers.HomeController.Index is executed by an anonymous user in 47 ms from ::1 IP address with succeed.
INFO 2019-09-03 18:51:34,395 [7 ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executing ViewResult, running view Index.
INFO 2019-09-03 18:51:34,806 [7 ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executed ViewResult - view Index executed in 468.7549ms.
INFO 2019-09-03 18:51:34,812 [7 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Demo.MyJob.Web.Controllers.HomeController.Index (Demo.MyJob.Web) in 613.974ms
INFO 2019-09-03 18:51:34,825 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 1250.0712ms 200 text/html; charset=utf-8
INFO 2019-09-03 18:51:34,991 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/sweetalert/dist/sweetalert.css
INFO 2019-09-03 18:51:34,991 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/toastr/toastr.css
INFO 2019-09-03 18:51:35,051 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/font-awesome/css/font-awesome.css
INFO 2019-09-03 18:51:35,085 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/bootstrap-paper/bootstrap.css
INFO 2019-09-03 18:51:35,109 [6 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/sweetalert/dist/sweetalert.css'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\sweetalert\dist\sweetalert.css'
INFO 2019-09-03 18:51:35,114 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/css/main.css
INFO 2019-09-03 18:51:35,114 [9 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/font-awesome/css/font-awesome.css'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\font-awesome\css\font-awesome.css'
INFO 2019-09-03 18:51:35,164 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/css/main.css'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\css\main.css'
INFO 2019-09-03 18:51:35,166 [7 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/toastr/toastr.css'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\toastr\toastr.css'
INFO 2019-09-03 18:51:35,169 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 177.5574ms 200 text/css
INFO 2019-09-03 18:51:35,169 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 177.8087ms 200 text/css
INFO 2019-09-03 18:51:35,169 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css
INFO 2019-09-03 18:51:35,169 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 54.5501ms 200 text/css
INFO 2019-09-03 18:51:35,169 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 117.3342ms 200 text/css
INFO 2019-09-03 18:51:35,190 [6 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\famfamfam-flags\dist\sprite\famfamfam-flags.css'
INFO 2019-09-03 18:51:35,190 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 20.6735ms 200 text/css
INFO 2019-09-03 18:51:35,257 [7 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/bootstrap-paper/bootstrap.css'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\bootstrap-paper\bootstrap.css'
INFO 2019-09-03 18:51:35,257 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 172.137ms 200 text/css
INFO 2019-09-03 18:51:35,283 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/moment/min/moment-with-locales.js
INFO 2019-09-03 18:51:35,286 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/json2/json2.js
INFO 2019-09-03 18:51:35,297 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/jquery-validation/dist/jquery.validate.js
INFO 2019-09-03 18:51:35,298 [7 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/json2/json2.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\json2\json2.js'
INFO 2019-09-03 18:51:35,300 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 14.5734ms 200 application/javascript
INFO 2019-09-03 18:51:35,300 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/bootstrap/dist/js/bootstrap.js
INFO 2019-09-03 18:51:35,305 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/jquery/dist/jquery.js
INFO 2019-09-03 18:51:35,327 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/jquery-validation/dist/jquery.validate.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\jquery-validation\dist\jquery.validate.js'
INFO 2019-09-03 18:51:35,327 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 29.4745ms 200 application/javascript
INFO 2019-09-03 18:51:35,369 [9 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/bootstrap/dist/js/bootstrap.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\bootstrap\dist\js\bootstrap.js'
INFO 2019-09-03 18:51:35,370 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 69.1099ms 200 application/javascript
INFO 2019-09-03 18:51:35,372 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/toastr/toastr.js
INFO 2019-09-03 18:51:35,373 [6 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/toastr/toastr.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\toastr\toastr.js'
INFO 2019-09-03 18:51:35,373 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 1.1496ms 200 application/javascript
INFO 2019-09-03 18:51:35,395 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/blockUI/jquery.blockUI.js
INFO 2019-09-03 18:51:35,400 [10 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/blockUI/jquery.blockUI.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\blockUI\jquery.blockUI.js'
INFO 2019-09-03 18:51:35,400 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 4.7696ms 200 application/javascript
INFO 2019-09-03 18:51:35,440 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/sweetalert/dist/sweetalert-dev.js
INFO 2019-09-03 18:51:35,443 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/spin.js/jquery.spin.js
INFO 2019-09-03 18:51:35,445 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/spin.js/jquery.spin.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\spin.js\jquery.spin.js'
INFO 2019-09-03 18:51:35,445 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 2.6389ms 200 application/javascript
INFO 2019-09-03 18:51:35,446 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/jquery/dist/jquery.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\jquery\dist\jquery.js'
INFO 2019-09-03 18:51:35,446 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 140.3229ms 200 application/javascript
INFO 2019-09-03 18:51:35,447 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/spin.js/spin.js
INFO 2019-09-03 18:51:35,451 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/sweetalert/dist/sweetalert-dev.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\sweetalert\dist\sweetalert-dev.js'
INFO 2019-09-03 18:51:35,451 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 11.1469ms 200 application/javascript
INFO 2019-09-03 18:51:35,521 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/spin.js/spin.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\spin.js\spin.js'
INFO 2019-09-03 18:51:35,521 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js
INFO 2019-09-03 18:51:35,521 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 73.7904ms 200 application/javascript
INFO 2019-09-03 18:51:35,521 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js
INFO 2019-09-03 18:51:35,521 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/abp.js
INFO 2019-09-03 18:51:35,521 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js
INFO 2019-09-03 18:51:35,522 [10 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\abp-web-resources\Abp\Framework\scripts\libs\abp.blockUI.js'
INFO 2019-09-03 18:51:35,522 [6 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/abp-web-resources/Abp/Framework/scripts/abp.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\abp-web-resources\Abp\Framework\scripts\abp.js'
INFO 2019-09-03 18:51:35,522 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 1.7359ms 200 application/javascript
INFO 2019-09-03 18:51:35,523 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 1.4094ms 200 application/javascript
INFO 2019-09-03 18:51:35,525 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\abp-web-resources\Abp\Framework\scripts\libs\abp.toastr.js'
INFO 2019-09-03 18:51:35,525 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 3.6857ms 200 application/javascript
INFO 2019-09-03 18:51:35,526 [7 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\abp-web-resources\Abp\Framework\scripts\libs\abp.jquery.js'
INFO 2019-09-03 18:51:35,526 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 5.0962ms 200 application/javascript
INFO 2019-09-03 18:51:35,555 [9 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/moment/min/moment-with-locales.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\moment\min\moment-with-locales.js'
INFO 2019-09-03 18:51:35,555 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 272.0541ms 200 application/javascript
INFO 2019-09-03 18:51:35,579 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js
INFO 2019-09-03 18:51:35,589 [9 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\abp-web-resources\Abp\Framework\scripts\libs\abp.sweet-alert.js'
INFO 2019-09-03 18:51:35,589 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 10.0396ms 200 application/javascript
INFO 2019-09-03 18:51:35,589 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/AbpScripts/GetScripts?v=637031334947750684
INFO 2019-09-03 18:51:35,591 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js
INFO 2019-09-03 18:51:35,592 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/AbpServiceProxies/GetAll?v=637031334947741174
INFO 2019-09-03 18:51:35,594 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\abp-web-resources\Abp\Framework\scripts\libs\abp.spin.js'
INFO 2019-09-03 18:51:35,595 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 3.413ms 200 application/javascript
INFO 2019-09-03 18:51:35,597 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/js/views/home/index.js
INFO 2019-09-03 18:51:35,601 [8 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/js/views/home/index.js'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\js\views\home\index.js'
INFO 2019-09-03 18:51:35,601 [8 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 4.6526ms 200 application/javascript
INFO 2019-09-03 18:51:35,627 [9 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetScripts", controller = "AbpScripts", area = ""}. Executing action Abp.AspNetCore.Mvc.Controllers.AbpScriptsController.GetScripts (Abp.AspNetCore)
INFO 2019-09-03 18:51:35,632 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/famfamfam-flags/dist/sprite/famfamfam-flags.png
INFO 2019-09-03 18:51:35,633 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetAll", controller = "AbpServiceProxies", area = ""}. Executing action Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore)
INFO 2019-09-03 18:51:35,725 [9 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Abp.AspNetCore.Mvc.Controllers.AbpScriptsController.GetScripts (Abp.AspNetCore) with arguments (, False) - Validation state: Valid
INFO 2019-09-03 18:51:35,730 [7 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/famfamfam-flags/dist/sprite/famfamfam-flags.png'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\famfamfam-flags\dist\sprite\famfamfam-flags.png'
INFO 2019-09-03 18:51:35,730 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 97.6549ms 200 image/png
INFO 2019-09-03 18:51:35,787 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore) with arguments (Abp.AspNetCore.Mvc.Proxying.ApiProxyGenerationModel) - Validation state: Valid
INFO 2019-09-03 18:51:35,789 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/lib/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3
INFO 2019-09-03 18:51:35,819 [7 ] NetCore.StaticFiles.StaticFileMiddleware - Sending file. Request path: '/lib/font-awesome/fonts/fontawesome-webfont.woff2'. Physical path: 'D:\GitHub\DotNetCore_Practice\ABP.WindowsService\Demo.MyJob\4.0.0\src\Demo.MyJob.Web\wwwroot\lib\font-awesome\fonts\fontawesome-webfont.woff2'
INFO 2019-09-03 18:51:35,823 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 33.8363ms 200 font/woff2
INFO 2019-09-03 18:51:35,924 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore), returned result Microsoft.AspNetCore.Mvc.ContentResult in 135.5736ms.
INFO 2019-09-03 18:51:35,936 [6 ] Mvc.Infrastructure.ContentResultExecutor - Executing ContentResult with HTTP Response ContentType of application/x-javascript
INFO 2019-09-03 18:51:35,937 [6 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore) in 304.1108ms
INFO 2019-09-03 18:51:35,937 [6 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 345.5179ms 200 application/x-javascript
INFO 2019-09-03 18:51:35,982 [9 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Abp.AspNetCore.Mvc.Controllers.AbpScriptsController.GetScripts (Abp.AspNetCore), returned result Microsoft.AspNetCore.Mvc.ContentResult in 256.5804ms.
INFO 2019-09-03 18:51:35,982 [9 ] Mvc.Infrastructure.ContentResultExecutor - Executing ContentResult with HTTP Response ContentType of application/x-javascript; charset=utf-8
INFO 2019-09-03 18:51:35,982 [9 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Abp.AspNetCore.Mvc.Controllers.AbpScriptsController.GetScripts (Abp.AspNetCore) in 354.8506ms
INFO 2019-09-03 18:51:35,982 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 392.9551ms 200 application/x-javascript; charset=utf-8
INFO 2019-09-03 18:51:36,186 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:62114/favicon.ico
INFO 2019-09-03 18:51:36,189 [9 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 3.4275ms 404

日志打印不全

先解决日志打印不全的问题。

这个问题跟log4net.config有关。

    <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5level %date [%-5.5thread] %-40.40logger - %message%newline" />
</layout>

%-40.40logger的意思是日志左对齐,若日志器的名称小于 40 个字符,则右边补空格。若日志器名称的长度大于 40 个字符,则截取。更多格式化配置请参考log4net.Layout.PatternLayout 用 conversion 模式格式化日志事件【翻译】 - 船长&CAP - 博客园

所以可以将上述配置改为

    <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5level %date [%-5.5thread] %c - %message%newline" />
</layout>

即只打印出日志器名称即可。

日志过滤

查询官方文档 .NET Core 和 ASP.NET Core 中的日志记录 | Microsoft Docs

查看源码 AspNetCore/HostingApplicationDiagnostics.cs at master · aspnet/AspNetCore

看到下述逻辑

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void BeginRequest(HttpContext httpContext, HostingApplication.Context context)
{
long startTimestamp = 0; if (HostingEventSource.Log.IsEnabled())
{
context.EventLogEnabled = true;
// To keep the hot path short we defer logging in this function to non-inlines
RecordRequestStartEventLog(httpContext);
} var diagnosticListenerEnabled = _diagnosticListener.IsEnabled();
var loggingEnabled = _logger.IsEnabled(LogLevel.Critical); if (loggingEnabled || (diagnosticListenerEnabled && _diagnosticListener.IsEnabled(ActivityName, httpContext)))
{
context.Activity = StartActivity(httpContext, out var hasDiagnosticListener);
context.HasDiagnosticListener = hasDiagnosticListener;
} if (diagnosticListenerEnabled)
{
if (_diagnosticListener.IsEnabled(DeprecatedDiagnosticsBeginRequestKey))
{
startTimestamp = Stopwatch.GetTimestamp();
RecordBeginRequestDiagnostics(httpContext, startTimestamp);
}
} // To avoid allocation, return a null scope if the logger is not on at least to some degree.
if (loggingEnabled)
{
// Scope may be relevant for a different level of logging, so we always create it
// see: https://github.com/aspnet/Hosting/pull/944
// Scope can be null if logging is not on.
context.Scope = _logger.RequestScope(httpContext, context.Activity); if (_logger.IsEnabled(LogLevel.Information))
{
if (startTimestamp == 0)
{
startTimestamp = Stopwatch.GetTimestamp();
} // Non-inline
LogRequestStarting(context);
}
}
context.StartTimestamp = startTimestamp;
}

有这样一行代码var loggingEnabled = _logger.IsEnabled(LogLevel.Critical);,又文档 .NET Core 和 ASP.NET Core 中的日志记录 | Microsoft Docs中提到

要禁止显示所有日志,可将 LogLevel.None 指定为最低日志级别。 LogLevel.None 的整数值为 6,它大于 LogLevel.Critical (5)。

所以分析之后得出了两种过滤方案。

官方文档提供的两种方案如下。

一种是代码中进行配置。

改造之前

    public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build(); host.Run();
}
}

改造之后

    public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.ConfigureLogging(logging =>
logging
.AddFilter("System", LogLevel.None)
.AddFilter("Microsoft", LogLevel.None)
)
.Build(); host.Run();
}
}

可以看到是ConfigureLogging在起作用,这里使用LogLevel.None级别,效果如下,只打印出了Abp的审计日志。

DEBUG 2019-09-03 20:02:21,753 [1    ] Abp.Modules.AbpModuleManager - Loading Abp modules...
DEBUG 2019-09-03 20:02:21,824 [1 ] Abp.Modules.AbpModuleManager - Found 10 ABP modules in total.
DEBUG 2019-09-03 20:02:22,003 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.Web.Startup.MyJobWebModule, Demo.MyJob.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,010 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.MyJobApplicationModule, Demo.MyJob.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,011 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.MyJobCoreModule, Demo.MyJob.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AutoMapper.AbpAutoMapperModule, Abp.AutoMapper, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,016 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AbpKernelModule, Abp, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,018 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.EntityFrameworkCore.MyJobEntityFrameworkCoreModule, Demo.MyJob.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,018 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule, Abp.EntityFrameworkCore, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,019 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkCommonModule, Abp.EntityFramework.Common, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,020 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetCore.AbpAspNetCoreModule, Abp.AspNetCore, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,021 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebCommonModule, Abp.Web.Common, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,024 [1 ] Abp.Modules.AbpModuleManager - 10 modules loaded.
DEBUG 2019-09-03 20:02:22,249 [1 ] Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule - Registering DbContext: Demo.MyJob.EntityFrameworkCore.MyJobDbContext, Demo.MyJob.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:02:22,457 [1 ] Abp.Localization.LocalizationManager - Initializing 3 localization sources.
DEBUG 2019-09-03 20:02:22,526 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp
DEBUG 2019-09-03 20:02:22,991 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: MyJob
DEBUG 2019-09-03 20:02:23,024 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb
DEBUG 2019-09-03 20:02:23,293 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Castle.Proxies.BackgroundJobManagerProxy
DEBUG 2019-09-03 20:02:23,351 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 0 classes define auto mapping attributes
INFO 2019-09-03 20:02:25,645 [6 ] Abp.Auditing.SimpleLogAuditingStore - AUDIT LOG: Demo.MyJob.Web.Controllers.HomeController.Index is executed by an anonymous user in 121 ms from ::1 IP address with succeed.

一种是配置文件指定日志级别

appsettings.json文件修改之前关于日志的配置如下

  "Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}

日志指定None级别

  "Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "None",
"System": "None",
"Microsoft": "None"
}
}

Web站点添加nuget包 NuGet Gallery | Microsoft.Extensions.Logging.Configuration 2.2.0

修改入口代码

        public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.ConfigureAppConfiguration((hostingContext, config) =>
{
var hostingEnvironment = hostingContext.HostingEnvironment;
config.AddJsonFile("appsettings.json", true, true)
.AddJsonFile("appsettings." + hostingEnvironment.EnvironmentName + ".json", true, true);
})
.ConfigureLogging((hostingContext, logging) =>
{
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
})
.Build(); host.Run();
}

如果你的web站点的sdk版本是2.2,可以使用WebHost.CreateDefaultBuilder(),创建默认的WebHostBuilder,该方法默认了上述的配置。源码请查看 AspNetCore/WebHost.cs at master · aspnet/AspNetCore。该方法在Microsoft.AspNetCore.App中,请引用包 NuGet Gallery | Microsoft.AspNetCore.App 2.2.0

去掉Abp审计日志

在MyJobWebModule的方法PreInitialize中关闭审计日志

Configuration.Auditing.IsEnabled = false;

去掉审计日志之后发现启动Abp框架的时候还是有日志记录下来,日志内容如下

DEBUG 2019-09-03 20:42:34,063 [1    ] Abp.Modules.AbpModuleManager - Loading Abp modules...
DEBUG 2019-09-03 20:42:34,129 [1 ] Abp.Modules.AbpModuleManager - Found 10 ABP modules in total.
DEBUG 2019-09-03 20:42:34,147 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.Web.Startup.MyJobWebModule, Demo.MyJob.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,170 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.MyJobApplicationModule, Demo.MyJob.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,171 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.MyJobCoreModule, Demo.MyJob.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,172 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AutoMapper.AbpAutoMapperModule, Abp.AutoMapper, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,173 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AbpKernelModule, Abp, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,174 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Demo.MyJob.EntityFrameworkCore.MyJobEntityFrameworkCoreModule, Demo.MyJob.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,174 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule, Abp.EntityFrameworkCore, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,175 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkCommonModule, Abp.EntityFramework.Common, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,178 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetCore.AbpAspNetCoreModule, Abp.AspNetCore, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,179 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebCommonModule, Abp.Web.Common, Version=4.8.1.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,185 [1 ] Abp.Modules.AbpModuleManager - 10 modules loaded.
DEBUG 2019-09-03 20:42:34,460 [1 ] Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule - Registering DbContext: Demo.MyJob.EntityFrameworkCore.MyJobDbContext, Demo.MyJob.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-03 20:42:34,704 [1 ] Abp.Localization.LocalizationManager - Initializing 3 localization sources.
DEBUG 2019-09-03 20:42:34,775 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp
DEBUG 2019-09-03 20:42:34,942 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: MyJob
DEBUG 2019-09-03 20:42:34,980 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb
DEBUG 2019-09-03 20:42:35,324 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Castle.Proxies.BackgroundJobManagerProxy
DEBUG 2019-09-03 20:42:35,368 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 0 classes define auto mapping attributes

什么原因导致的呢?分析过程,如下

解决方案:

修改log4net.config配置文件

原配置内容

  <root>
<level value="DEBUG" />
<appender-ref ref="RollingFile" />
</root>

修改为

  <root>
<level value="INFO" />
<appender-ref ref="RollingFile" />
</root>

启动验证一下,正常运行之后发现不需要记录的日志都已经过滤掉了。

过滤掉Abp框架不需要记录的日志的更多相关文章

  1. ABP框架踩坑记录

    ABP框架踩坑记录 ASP.NET Boilerplate是一个专用于现代Web应用程序的通用应用程序框架. 它使用了你已经熟悉的工具,并根据它们实现最佳实践. 文章目录 使用MySQL 配置User ...

  2. X-Admin&ABP框架开发-系统日志

    网站正常运行中有时出现异常在所难免,查看系统运行日志分析问题并能够根据错误信息快速解决问题尤为重要,ABP对于系统运行日志这块已经做了很好的处理,默认采用的Log4Net已经足够满足开发过程中的需要了 ...

  3. ABP框架记录

    1.先在Core项目中建立模型Models>Model.cs/ModelManager.cs 2.在Application中建立接口和具体类:IModelAppService.csModelAp ...

  4. ABP框架实践基础篇之开发UI层

    返回总目录<一步一步使用ABP框架搭建正式项目系列教程> 说明 其实最开始写的,就是这个ABP框架实践基础篇.在写这篇博客之前,又回头复习了一下ABP框架的理论,如果你还没学习,请查看AB ...

  5. ABP框架详解(三)Domain

    此处的Domain主要指Abp类库根目录下Domain文件夹.顾名思义该目录下是用来存放与领域实体,领域逻辑执行,存储,领域服务相关的内容. 1.Entities (1)为整个Abp框架后期开发的所有 ...

  6. ABP框架实战 1.基础信息维护

    在之前的一个开发项目中,因为公司战略发展,引用了这个ABP开源框架作为新项目的基础版本,由于客户的要求需要迁移旧系统数据,以及其他的一些原因,数据库采用了Oracle数据库管理.所以引用了Dapper ...

  7. 手工搭建ABP框架(1) - Web项目

    为了防止不提供原网址的转载,特在这里加上原文链接: http://www.cnblogs.com/skabyy/p/7295533.html ABP是 ASP.NET Boilerplate Proj ...

  8. ABP框架个人开发实战(1)_环境搭建

    前言 之前关注ABP框架有一阵子了,一直没有潜下心来实际研究一下.最近想自己建站,以后有自己的功能开发项目,可以在自己的站点上开发,并一步步的完善,所以找个比较好用的框架迫在眉睫,选来选去,决定用AB ...

  9. 后台工作者HangFire与ABP框架Abp.Hangfire及扩展

    HangFire与Quartz.NET相比主要是HangFire的内置提供集成化的控制台,方便后台查看及监控,对于大家来说,比较方便. HangFire是什么 Hangfire是一个开源框架(.NET ...

随机推荐

  1. Pinyin4j简单使用教程

    Pinyin4j是一个流行的Java库,支持中文字符和拼音之间的转换,拼音输出格式可以定制,在项目中经常会遇到需求用户输入汉字后转换为拼音的场景,这时候Pinyin4j就可以派上用场 有自己私服的可以 ...

  2. rabbitMQ_topic(五)

    主题转发器 发送到主题转发器的消息不能有任意的 routing_key - 它必须是由点分隔的单词列表.这些单词可以是任何东西,但通常它们指定与消息相关联的一些功能.几个有效的routeKey示例:“ ...

  3. springboot的邮件服务

    作者:纯洁的微笑出处:http://www.ityouknow.com/ 版权归作者所有,转载请注明出处 springboot仍然在狂速发展,才五个多月没有关注,现在看官网已经到1.5.3.RELEA ...

  4. 贪心算法---The best time to buy and sell store-ii

    Say you have an array for which the i th element is the price of a given stock on day i. Design an a ...

  5. T-SQL 恢复数据库

    USE master GO ALTER DATABASE DEMO SET SINGLE_USER GO ALTER DATABASE DEMO SET EMERGENCY GO DBCC CHECK ...

  6. DesignPattern系列__02接口隔离原则

    介绍 客户端不应该依赖它不需要的接口,即一个类对另一个类的依赖应该建立在最小接口上. Demo引入 先来看一张图: interface MyInterface { void operation1(); ...

  7. SpringMVC学习笔记之---简单入门

    SpringMVC简单入门 (一)什么是MVC设计模式 (1)model:模型数据,业务逻辑 (3)view:呈现模型,与用户进行交互 (3)controller:负责接收并处理请求,响应客户端 (二 ...

  8. 改 Anaconda Jupyter Notebook 开发文件保存目录

    1.打开cmd,输入命令找到配置文件路径 jupyter notebook --generate-config 2.打开 jupyter_notebook_config.py 修改配置 c.Noteb ...

  9. sqoop增量导数据

    sqoop要实现增量导入参数到hive或者hdfs 1.需要在mysql中创建可以自动更新的字段,当插入数据时和更新数据时改字段自动更新,如图中update_time,当数据插入时会记录更新为插入时间 ...

  10. Altium Designer16绘制51单片机的一些经验总结

    制作这块51单片机的还是蛮艰辛的,应该是我水平太差,现在这块51板已经稳定了,也把这块板子制作过程中的一些问题及经验总结记录下来.这块板子制作出了很大问题很大原因是因为我对Altium Designe ...