I have a Visual Studio 2015 extension, and would like to use log4net. However, I'm not getting any log messages, and not even internal debugging messages from log4net.
In the Package class I have:
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
and later in the Initialize method I have:
if (!log4net.LogManager.GetRepository().Configured)
{
log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo("C:\\Program Files\\Sym\\bin\\Log4NetSettingsGlobal.xml"));
}
log.Debug("Package Initialize");
In the VSX project's app.config I have this:
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Program Files\Sym\Logging\Log4Net_Trace_VSX.txt"/>
</listeners>
</trace>
</system.diagnostics>
...
</configuration>
Nothing gets written to the text file above. Nothing gets written to the output window when I debug the extension in VS, that is, a second instance of VS is opened so that I can test the extension.
I added a DebugAppender too from this SO question. Still nothing in the output window.
What am I doing wrong?