0

I installed stackify (which works fine in another project) and cannot get it to report anything from this project. All config files/etc match exactly. Am I missing something obvious?

Config file:

<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>

    <add key="Stackify.AppName" value="[app name]" />
    <add key="Stackify.Environment" value="Development" />
    <add key="Stackify.ProxyServer" value="" />
    <add key="Stackify.ApiKey" value="[key]" />

<nlog>
    <extensions>
        <add assembly="StackifyLib.nLog" />
    </extensions>
    <targets>
        <target name="stackify" type="StackifyTarget" globalContextKeys="" mappedContextKeys="" callContextKeys="" logMethodNames="true" />
    </targets>
    <rules>
        <logger name="*" minlevel="Debug" writeTo="stackify" />
    </rules>
</nlog>

To call it (no calls work, just an example):

LogManager.GetCurrentClassLogger().Log(LogLevel.Error, ex);

As far as I can tell, it is exactly the same as the working project except it, well, doesn't work. Am I missing something?

Thanks, James

James F
  • 535
  • 9
  • 26
  • I spent a few hours to basically determine it will only write when stepping through the application - if you just run it, it won't log, if you step through in debug, it does. I've just switched to standard nLog, which works fine. – James F Jun 01 '16 at 13:46
  • James, you might add `StackifyLib.Logger.Shutdown();` prior to the app shut down. – danatcofo Feb 15 '17 at 20:58

1 Answers1

0

Wrap the <add key="Stackify...../> in a <appSettings>-block:

<appSettings>
  <add key="Stackify.AppName" value="[app name]" />
   <add key="Stackify.Environment" value="Development" />
  <add key="Stackify.ProxyServer" value="" />
  <add key="Stackify.ApiKey" value="[key]" />
</appSettings>
  • I had it wrapped in the normal app settings section, I had just cropped it out due to all the other settings. Thanks though. – James F Jun 01 '16 at 13:45