Search code examples
asp.net-corelog4netaspnetboilerplate

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. 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. after some moment the logs.txt file was very huge and find some especial error in it is very hard. could you help me to disable log the background job worker?

vs code terminal after dotnet run in host vs code terminal after dotnet run in host

logs.txt file logs.txt file


Solution

  • I was suffering the same issue here, and found a way to do this through log4net (not abp). The trick I used is prevent logging from specific loggers (the ones that keep logging every 5 seconds). Here is the log4net config file, with the added filters log4net config with