NetEscapades.Extensions.Logging
NetEscapades.Extensions.Logging copied to clipboard
No logfile written when LogDirectory is in an absolute path
Is there any special syntax to be used for absolute paths? Things work just fine when I provide a relative path in options.LogDirectory, but when I use an absolute one (in my example:
options.LogDirectory = @"c:\temp\";
no logfile is being written.
Hi, that works fine - it's likely due to the folder not being somewhere ASP.NET Core has write access to. Try using an absolute path somewhere inside your project folder for example
Using an absolute path that's inside the project folder does work indeed. Why would ASP.NET Core not have acces to other paths though? Our traditional ASP.NET MVC projects all write to c:\temp which works just fine.
When I debug the app without IIS, it also works. But where is the permission system for the ASP.NET core runtime managed? Why has it less access then the owner of the IIS express task?
It's a good question, and I'm not sure of the answer.
But where is the permission system for the ASP.NET core runtime managed?
That depends how you're running your app - if you're using IIS then it runs under the app pool user. Otherwise it's whichever user starts the dotnet
process