VS2005 established asp.net project, log4net file in Web.config file
1. Same as vs2003.
2. Same as vs2003.
3. Same as vs2003.
4. Read the configuration in the application code (there is no AssemblyInfo.cs file here vs2005, so there is a less method than vs2003, and global.asax the foreground page and the background page in the same file, if any location settings in the Global.asax are wrong, [Assembly:log4net. Config.domconfigurator (configfile= "Web.config", Watch=true)], there are only 1 ways, correct c)
5. In the WebForm1.aspx.cs Page_Load of Web projects
Here to think about, a project will certainly be in many pages to log, so in every page file to write this and inconvenient, it is not possible, so we use the next program, generally our project will be so designed
5. In the WebForm1.aspx.cs Page_Load of Web projects
VS2005 established asp.net project, log4net files in a separate file Log4net.config, plus, put the log records in a separate public project, because often the project will design a public layer, implementation of logging, cache management, encryption, security, etc.
This also avoids the disadvantage of success example three, which can be read only in one place
We add a public project framework project here
That is, [assembly:log4net. Config.domconfigurator (configfile= "Log4net.config", Watch=true)]
1. Ditto (add Reference) now it's OK to add to the framework public project,
2. Add in the web.config of a Web project (position or under <configuration> tab)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.