NLog in ASP.NET - what permissions should the log file have (archiving issue)

For ASP.Net, what permissions should the log files created by NLog have? The ASP.Net virtual directory uses an application pool that has an "Application Pool Identifier" in the "Network Service".

When I grant the rights to change the "Network Service" to the NLog output file, everything will be fine until the archiving condition causes the original log file to become X_0001 and a new X will be created - the new X now has any rights for longer Network Service ", and therefore an error occurs when trying ASP.Net scripts.

I cannot find links to this on the NLog website. Any information is appreciated.

+3
source share
1 answer

Assign permissions to the folder and make sure that the permissions are inherited by the files created in this folder. Thus, any new file will automatically receive the permissions you need.

+2
source

Source: https://habr.com/ru/post/1717094/


All Articles