0

I am trying to create a error log file in the path \MMWeb\MMServiceLogs using log4net. Here MMWeb is the my web project in ASP.Net Core MVC application. For that I have tried below combination of file paths in the log4net.config file which is placed inside the MMWeb folder.

 <file value=".\\MMServiceLogs\MMLoggerService.log" />
 <file value="./MMServiceLogs/MMLoggerService.log" />
 <file value="~/MMServiceLogs/MMLoggerService.log" />

But with these, log file is not being created in \MMWeb\MMServiceLogs folder. Instead it is being created in the \MMWeb\bin\Debug\netcoreapp3.1 folder. When I tried changing the path as <file value="C:\Temp\app.log" />, it was working.

  • https://stackoverflow.com/questions/1535736/how-can-i-change-the-file-location-programmatically – Amit Mar 08 '22 at 06:27

0 Answers0