Need some Design suggestion in C#
<p>I have a LOG class which uses Microsoft Enterprise Logging. As per my initial design, this was a Static Class and was using "App.Config". </p>

<p>Problem came when I have to use this class as part of my Class Library which will be deployed in GAC. Since the class libraries don't have an App.Config, I have to use my calling application's "App.Config". Hence I changed from Static to normal instantiated class
.
I followed the approach of configuring the path of my Logging config in the Application's config file. I got a feedback on how to use this from this thread (<a href="http://stackoverflow.com/questions/4611915/question-regarding-app-config-for-class-library-and-logging">question-regarding-app-config-for-class-library-and-logging</a></p>

<p>I used this approach and everything worked perfectly fine when I use this Logger object in only one class</p>

<p>This is my approach (in nutshell):</p>

<ol>
<li>In my Main class (ex: Class A) I get the value from App.Config </li>
<li><p>I Initiate the Logger class with the constructor getting the path of the Configuration file</p>

<p>LogHandler = new LogHelper(logConfigFileLocation);</p></li>
<li><p>I use this <code>LogHandler</code> in my class <code>class A</code></p></li>
</ol>

<p>I now stumble across this problem. </p>

<p>I have other classes <code>Class B</code> and <code>Class C</code> in which i want to use this <code>LogHandler</code>. I use the <code>Class B</code> and <code>Class C</code> in <code>Class A</code> </p>

<p>If i do an instance of the LogHandler class, I would get a new log file.</p>

<p>How should i define my LogHandler Class? Should I go for a singleton approach?</p>

<p>Looking forward for some suggestions</p>

<p>Cheers, </p>

<p>Karthik</p>
