Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing single log4net config file across multiple projects
    primarykey
    data
    text
    <p>I'm trying to use a solution that I've put together from a few other answers on here. Basically I'm trying to use one log4net config file for a solution that has multiple projects. </p> <p>Here is my config file:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" ?&gt; &lt;log4net&gt; &lt;appender name="FileMonitorAppender" type="log4net.Appender.FileAppender"&gt; &lt;file type="log4net.Util.PatternString" value="C:\Documents and Settings\user1\My Documents\My Box Files\FOBS\logs\Box File Monitor %date{MM.dd.yyyy'_'hh.mm.ss''}.txt" /&gt; &lt;appendToFile value="true"/&gt; &lt;layout type="log4net.Layout.PatternLayout"&gt; &lt;header value="[START: Box File Monitor Run %date]%newline" type="log4net.Util.PatternString" /&gt; &lt;conversionPattern value="%date{HH:mm:ss} - %-5level- %message%newline" /&gt; &lt;footer value="[END: Box File Monitor Run]" /&gt; &lt;/layout&gt; &lt;/appender&gt; &lt;root&gt; &lt;level value="ALL"/&gt; &lt;appender-ref ref="FileMonitorAppender" /&gt; &lt;/root&gt; &lt;/log4net&gt; </code></pre> <p>and here is where I'm calling the logger in code:</p> <pre class="lang-cs prettyprint-override"><code>private static readonly ILog _log = LogManager.GetLogger("Duke.Mobile.FileMonitorAutomation.FileMonitor"); </code></pre> <p>and I also have this in the calling assembly which is supposed to configure the logger:</p> <pre class="lang-cs prettyprint-override"><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)] </code></pre> <p>I have the log4net.config file in a solution folder and then have it added to the calling assembly as a linked file. When the app runs, it never hits the configuration. I've seen a couple of similar problems but it's never set up exactly this way, hoping someone can help.</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.
 

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