当前位置:网站首页>Log cannot be recorded after log4net is deployed to the server
Log cannot be recorded after log4net is deployed to the server
2022-07-04 09:33:00 【Dandelion_ drq】
It can be recorded in the development environment , But not after the release . I have been troubled by this problem for a long time , Today, I finally found the reason !!
my log4net
The configuration file is written separately , It is saved in the root directory of the project .
The way to specify the configuration file is through AssemblyInfo.cs
add to [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
This code specifies .
Above is my project structure . I encapsulated one in the project LogHelper
, call log4net
Methods of are written in this class , This class is in the Common
Under the project , Then other projects cite Common
Under the LogHelper
, So I only changed the quoted Common
Project AssemblyInfo.cs
file , And the correct way is to modify the main project AssemblyInfo.cs
file !!
ok …… After the change, it was OK ……OTL
PS: If you use the method of recording to file , You may need to give IIS_IUSRS
User configured folder read and write permissions .
边栏推荐
- The child container margin top acts on the parent container
- How does idea withdraw code from remote push
- 2022-2028 global optical transparency industry research and trend analysis report
- 什么是uid?什么是Auth?什么是验证器?
- Development trend and market demand analysis report of high purity tin chloride in the world and China Ⓔ 2022 ~ 2027
- el-table单选并隐藏全选框
- Review of last week's hot spots (6.27-7.3)
- HMS core helps baby bus show high-quality children's digital content to global developers
- Research Report on research and investment prospects of China's testing machine industry (2022 Edition)
- Explanation of for loop in golang
猜你喜欢
HMS core helps baby bus show high-quality children's digital content to global developers
SSM online examination system source code, database using mysql, online examination system, fully functional, randomly generated question bank, supporting a variety of question types, students, teache
2022-2028 global seeder industry research and trend analysis report
How to batch change file extensions in win10
Reload CUDA and cudnn (for tensorflow and pytorch) [personal sorting summary]
ArrayBuffer
C语言-入门-基础-语法-[运算符,类型转换](六)
el-table单选并隐藏全选框
Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)
Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310
随机推荐
Opencv environment construction (I)
UML sequence diagram [easy to understand]
2022-2028 global edible probiotic raw material industry research and trend analysis report
C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)
Jianzhi offer 09 realizes queue with two stacks
pcl::fromROSMsg报警告Failed to find match for field ‘intensity‘.
2022-2028 global protein confectionery industry research and trend analysis report
Lauchpad x | MODE
Dede plug-in (multi-function integration)
如何编写单元测试用例
Global and Chinese market of bipolar generators 2022-2028: Research Report on technology, participants, trends, market size and share
China battery grade manganese sulfate Market Forecast and strategic consulting report (2022 Edition)
PMP registration process and precautions
How does idea withdraw code from remote push
Write a jison parser from scratch (1/10):jison, not JSON
《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)
Tkinter Huarong Road 4x4 tutorial II
Explain TCP protocol in detail three handshakes and four waves
2022-2028 global gasket metal plate heat exchanger industry research and trend analysis report
What is inner connection and outer connection? What are the uses and benefits