Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log4Net configuration in a plugin dll?

Tags:

c#

.net

log4net

We have a plugin that gets distributed with third party software (also with our own software) Our plugin is written in C# and contains some log4net logging. In our own software, we have a .exe.config that contains our log4net section and allows for configuration. However on the third-party side we are unable to do this.

Any suggestions on how I can configure it from within the code? (Assuming it has not already been configured, in the case of our own software)?

like image 833
Kyle Avatar asked May 18 '11 19:05

Kyle


1 Answers

It's possible to do it, but IMHO it's not a good idea. It's the application, not the libraries, that decides if/how/when/where/what to log. Libraries should only offer logging support (you already do this).

like image 170
Mauricio Scheffer Avatar answered Oct 02 '22 11:10

Mauricio Scheffer