Logging

From v10.0.150 it has become possible to capture logs from FluenceXL activity.

Configuration

The log configuration can have different output targets which you can configure as shown below.

You can set the minimum logging level to restrict which events are logged. The following levels are available, from noisiest to quietest:

  • Verbose
  • Debug
  • Information (the default)
  • Warning
  • Error
  • Fatal

Excel add-in

You can enable logging in the add-in options: Options > FluenceXL Options > User Interaction tab > Enable Logging

Then you need to add a file path for the log file, e.g. c:\temp\log.txt

You will have to restart Excel if you change the configuration.

Manually enabling the Excel add-in log

Create the appsettings.json log configuration file in %appdata%\XLCubed Ltd\XLCubed Excel Edition (you can type this address into File Explorer to go to the correct folder) then restart Excel.

Web

By default, the appsettings.json log configuration file is deployed in the /FluenceXLWeb installation directory, and will log to a file in the Logs sub-directory.

Sample configurations

File logging

This will log Verbose messages to a file. Note that backslashes in the file path must be doubled.

{
 "Serilog": {
   "MinimumLevel": "Verbose",
   "WriteTo": [
     {
       "Name": "File",
       "Args": {
         "path": "C:\\Path\\To\\Logs\\error.log",
         "rollingInterval": "Day",
         "retainedFileCountLimit": 10,
         "restrictedToMinimumLevel": "Verbose"
       }
     }
   ]
 }
}

System Debug output stream

Alternatively, you can log to the debug output, which you can capture using DebugView a free tool from Microsoft. Note that this will have information from other programs running on the computer, so may be harder to interpret.

{
 "Serilog": {
   "MinimumLevel": "Verbose",
   "WriteTo": [
     { "Name": "Debug" }
   ]
 }
}

Microsoft Application Insights

You can enable Microsoft Application Insights by copying Serilog.Sinks.ApplicationInsights.dll and Microsoft.ApplicationInsights.dll into the installation folder (the bin folder for a web installation) and setting your appsettings.json to load them:

{
 "Serilog": {
   "Using": [
     "Serilog.Sinks.ApplicationInsights"
   ],
   "MinimumLevel": "Verbose",
   "WriteTo": [
     {
       "Name": "ApplicationInsights",
       "Args": {
         "telemetryConverter": "Serilog.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights"
       }
     }
   ]
 }
}

The connectionString argument is optional if the Application Insights connection string has either been placed in a APPLICATIONINSIGHTS_CONNECTION_STRING environment variable or application setting, when using an App Service.

Note that depending on the exact version numbers, you may need to add assembly redirection:

<dependentAssembly>
 <assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral" />
 <bindingRedirect oldVersion="0.0.0.0-2.21.0.429" newVersion="2.21.0.429" />
</dependentAssembly>