简体   繁体   English

如何防止在 logs.txt 文件中保存后台作业调用

[英]How to prevent saving background job calls in logs.txt file

I am working on project that is uses abp (asp net boilerplate) v 6.3.0 and dotnet core v5 with reactjs client.我正在研究使用 abp(asp net 样板)v 6.3.0 和带有 reactjs 客户端的 dotnet core v5 的项目。 After run its server with dotnet run, I see some logs on the terminal that is show the background jobs are working and this messages are saving in the logs.txt file.使用 dotnet run 运行其服务器后,我在终端上看到一些日志,显示后台作业正在运行,并且此消息保存在 logs.txt 文件中。 after some moment the logs.txt file was very huge and find some especial error in it is very hard.过了一会儿,logs.txt 文件变得非常大,很难在其中找到一些特别的错误。 could you help me to disable log the background job worker?你能帮我禁用后台工作人员的日志吗?

vs code terminal after dotnet run in host dotnet在主机中运行后的vs代码终端dotnet在主机中运行后的vs代码终端

logs.txt file日志.txt 文件日志.txt 文件

I was suffering the same issue here, and found a way to do this through log4net (not abp).我在这里遇到了同样的问题,并找到了一种通过 log4net(不是 abp)来做到这一点的方法。 The trick I used is prevent logging from specific loggers (the ones that keep logging every 5 seconds).我使用的技巧是防止从特定记录器(每 5 秒记录一次的记录器)进行记录。 Here is the log4net config file, with the added filters log4net config with这是 log4net 配置文件,添加了过滤器log4net 配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM