This article is a mirror article of machine translation, please click here to jump to the original article.

View: 61184|Reply: 1

[Source] .net/c# log4net logs cannot be written to a file

[Copy link]
Posted on 6/1/2017 10:44:55 AM | | | |
I have a habit of writing a log when the website starts

Today I suddenly found that the Alibaba Cloud server could not write logs normally with log4net.

why??? Where did I misconfigure???? But it was all good before

Then, I debugged it from the local computer, and it was good, I could write logs normally

Then, I re-updated the release package on the server, but I still couldn't write the log normally, which was not over

。。。。。。。。。。。。。。。。。。。。。。。。。。。

Suddenly, I remembered that after the "Wana Decrypt0r ransomware" was updated with Microsoft patches, it would cause some folders or files to be unable to be added or changed

Is this the reason??? Then, comparing the local "App_Log" folder with the "App_Log" folder of the server, I found that there was really a difference in permissions

Solution:

1: Right-click on the log folder and select Properties to find Safe

2: Add the "Authenticated Users" permission, as shown in the figure below, and find that it has been successfully resolved!

The Authenticated Users user group has the ability to add 10 computer accounts to an Active Directory domain. These new computer accounts are created in the machine container.
Replacing the Everyone group with this group prevents anonymous access.







Previous:[SDL Programming] VC environment construction under windosXP
Next:C# control dual buffer control
 Landlord| Posted on 4/11/2021 4:46:13 PM |
It can also be solved by (not tested, it should logically work)

Right-click on the folder or file Properties—>Security—Edit—Add—" and enterIIS APPPOOL\Application pool name

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com