Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you configure and enable log4net for a stand-alone class library assembly?
    primarykey
    data
    text
    <h2>Background</h2> <p>I am writing a class library assembly in C# .NET 3.5 which is used for integration with other applications including third-party Commercial-Off-The-Shelf (COTS) tools. Therefore, sometimes this class library will be called by applications (EXEs) that I control while other times it will be called by other DLLs or applications that I do <strong>not</strong> control.</p> <h2>Assumptions</h2> <ul> <li>I am using C# 3.0, .NET 3.5 SP1, and Visual Studio 2008 SP1</li> <li>I am using log4net 1.2.10.0 or greater</li> </ul> <h2>Constraints</h2> <p>Any solution must:</p> <ul> <li>Allow for the class library to enable and configure logging via it's own configuration file, if the calling application does not configure log4net.</li> <li>Allow for the class library to enable and configuring logging via the calling applications configuration, if it specifies log4net information</li> </ul> <p>OR</p> <ul> <li>Allow for the class library to enable and configuring logging using it's own configuration file at all times.</li> </ul> <h2>Problem</h2> <p>When my stand-alone class library is called by a DLL or application that I do not control (such as a third-party COTS tool) and which doesn't specify log4net configuration information, my class library is unable to do any of it's logging.</p> <hr> <h2>Question</h2> <p><strong>How do you configure and enable log4net for a stand-alone class library assembly so that it will log regardless if the calling application provides log4net configuration?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload