Recently in a class library, written in C #, in order to debug the need for convenient log output, and then found log4net this tool for log output;
Because call this class library is C + +, and I am not very familiar with C + +, so can not be configured in the App. config or Web. config log4net parameters, in addition to Google or Baidu, also did not find a good solution;
Finally found a Baidu library of a detailed log4net document to see, their own reference to other information toss good.
1, create a new XML document Log4net.xml, the configuration of log4net parameters inside;
2, the project AssemblyInfo.cs inside add [assembly:log4net. Config. domconfigurator (configfile= "Log4net.xml", watch=true)], so project Engineering and Log4net have established the association;
This allows you to write your own class library when you need the log output, directly to the Log4net.dll and Log4net.xml, and your library copy to other people can be. Without the need for the caller to go to the additional configuration;
Using Log4net in class libraries