These are chat archives for exceptionless/Discuss

13th
Jul 2015
Simon C
@Workshop2
Jul 13 2015 10:29
Hello all, I am struggling to get Nlog target working with my web app
Is there anyone here that could help me
Blake Niemyjski
@niemyjski
Jul 13 2015 12:56
Hey
Sure what kind of issue are you seeing @Workshop2
Simon C
@Workshop2
Jul 13 2015 13:57
As soon as I add the NLog targets, none of my logging works.
I have 2 log targets, one is to file and one is to Exceptionless (a self hosted version)

<?xml version="1.0" encoding="utf-8"?>

<configuration>

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

<extensions>
<add assembly="Exceptionless.NLog"/>
</extensions>

<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<!-- Daily log files, deleted after 7 days -->
<target name="Search.Web" xsi:type="File" fileName="D:\ErrorLogs\Search\errors.web.log" archiveFileName="D:\ErrorLogs\Search\errors.web.{#}.log" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="7" />

<target name="exceptionless" xsi:type="Exceptionless">
<field name="host" layout="${machinename}" />
<field name="identity" layout="${identity}" />
<field name="windows-identity" layout="${windows-identity:userName=True:domain=False}" />
<field name="process" layout="${processname}" />
</target>
</targets>

<rules>
<logger name="ErrorLog" minlevel="Debug" writeTo="Search.Web" />
<logger name="*" minlevel="Info" writeTo="exceptionless" />
</rules>
</nlog>
</configuration>

In that status, if I "NLog.LogManager.GetLogger("ErrorLog")" then it says none of the logging statuses are enabled
but only when the exceptionless target is added
I haven't found much documentation around NLog for exceptionless - been trying to get it working for a while now :S
Simon C
@Workshop2
Jul 13 2015 14:05
ok
sorry everyone
my fault - I put the extensions outside of the nlog section
Simon C
@Workshop2
Jul 13 2015 14:38
How can I get the Exceptionless NLog plugin to use the default client (ApiKey, ServerUrl and SSL settings) & also contain MVC/Web tracking information such as URL...
Blake Niemyjski
@niemyjski
Jul 13 2015 14:57
@Workshop2 It should do this by default
But for the tracking information such as request info, you'll need to set the context property with the action context / http context
.ContextProperty("HttpActionContext", ActionContext)
like that
Blake Niemyjski
@niemyjski
Jul 13 2015 15:02
@Workshop2 were you not seeing the api key being picked up by the nlog target?
@hmemcpy what all packages do you have installed?
Blake Niemyjski
@niemyjski
Jul 13 2015 15:10
@Workshop2 the last comment was for you. If you need any help, please let me know.. We are here to help you