NLog.config update required after upgrade of AppSpider Enterprise
There was an issue with the System Event Logs not appearing in the AppSpider Enterprise UI from release 3.8.227, which required a change in the NLog.config file.
The fix has been addressed in Appspider Enterprise 3.8.231 and a fresh install of this release includes the change.
However, with upgrades of Appspider Enterprise, the NLog.config file is not overwritten as the customer may have customized the settings, so a manual change is required.
Manually configure the NLog file
Navigate to where AppSpider Enterprise is installed. For example, C:\Program Files (x86)\Rapid 7\AppSpider Enterprise 3.8\IIS.NET
Open the NLog.config file in an editor and add the following line above the
<targets>
element:
1<variable name="connectionString" value="Server" />
- Add the following target to the
<targets>
element:
1<target name="database"2xsi:type="Database"3dbProvider="System.Data.SqlClient"4connectionString="${var:connectionString}"5commandText="6INSERT INTO [DATABASE_NAME].[dbo].[Log] (Date, Thread, Level, Logger, Message, Exception, UserId, ClientId, Url)7VALUES (@Date, @Thread, @Level, @Logger, @Message, @Exception, NULLIF(@UserId, 'None'), NULLIF(@ClientId, 'None'), @Url) ">8<parameter name="@Date" layout="${date}" dbType="DateTime" />9<parameter name="@Thread" layout="${threadname:whenEmpty=${threadid}}" />10<parameter name="@Level" layout="${level:uppercase=true}" />11<parameter name="@Logger" layout="${logger}" />12<parameter name="@Message" layout="${message}" />13<parameter name="Exception" layout="${exception:format=tostring,stacktrace:innerFormat=tostring:innerException}" />14<parameter name="@UserId" layout="${event-properties:item=user}" />15<parameter name="@ClientId" layout="${event-properties:item=client}" />16<parameter name="@Url" layout="${aspnet-request-url}" />17</target>
Insert the name of the database which AppSpider Enterprise connects to, in the commandText attribute, replacing the ‘DATABASE_NAME’ text. Example: INSERT INTO [DATABASE_NAME] ⇒ INSERT INTO [ASE]
Update the
<rules>
element of the NLog.config file, to add the database to the writeTo attribute in the relevant logger level. Example:<logger name="*" levels="Fatal,Error" writeTo="file, eventlog, database" />
To apply this change, restart IIS.