当前位置:网站首页>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 .
边栏推荐
- Lauchpad x | MODE
- 20220701 Barbalat引理证明
- Analysis report on the production and marketing demand and investment forecast of tellurium dioxide in the world and China Ⓣ 2022 ~ 2027
- Upgrading Xcode 12 caused Carthage to build cartfile containing only rxswift to fail
- Dede plug-in (multi-function integration)
- "How to connect the network" reading notes - Web server request and response (4)
- Leetcode (Sword finger offer) - 35 Replication of complex linked list
- 2022-2028 global protein confectionery industry research and trend analysis report
- pcl::fromROSMsg报警告Failed to find match for field ‘intensity‘.
- PHP personal album management system source code, realizes album classification and album grouping, as well as album image management. The database adopts Mysql to realize the login and registration f
猜你喜欢
Leetcode (Sword finger offer) - 35 Replication of complex linked list
2022-2028 global edible probiotic raw material industry research and trend analysis report
Explain TCP protocol in detail three handshakes and four waves
Markdown syntax
Nurse level JDEC addition, deletion, modification and inspection exercise
el-table单选并隐藏全选框
2022-2028 global intelligent interactive tablet industry research and trend analysis report
PHP student achievement management system, the database uses mysql, including source code and database SQL files, with the login management function of students and teachers
Latex download installation record
Svg image quoted from CodeChina
随机推荐
2022-2028 global optical transparency industry research and trend analysis report
Analysis report on the production and marketing demand and investment forecast of tellurium dioxide in the world and China Ⓣ 2022 ~ 2027
如何编写单元测试用例
You can see the employment prospects of PMP project management
2022-2028 global tensile strain sensor industry research and trend analysis report
C language - Introduction - Foundation - syntax - [identifier, keyword, semicolon, space, comment, input and output] (III)
MySQL foundation 02 - installing MySQL in non docker version
Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)
Report on investment analysis and prospect trend prediction of China's MOCVD industry Ⓤ 2022 ~ 2028
Global and Chinese market of air fryer 2022-2028: Research Report on technology, participants, trends, market size and share
HMS core helps baby bus show high-quality children's digital content to global developers
【leetcode】29. Divide two numbers
C language - Introduction - Foundation - syntax - [operators, type conversion] (6)
保姆级JDEC增删改查练习
Svg image quoted from CodeChina
2022-2028 global intelligent interactive tablet industry research and trend analysis report
Some points needing attention in PMP learning
Write a jison parser from scratch (1/10):jison, not JSON
How to write unit test cases
Reading notes on how to connect the network - hubs, routers and routers (III)