Parse Azure /LogFiles/http/RawLogs Web Server File System Logs to a SQL Database
C#
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts
src
.gitignore
LICENSE
README.md
package.json

README.md

Azure HTTP Web Server Logs to SQL

If you enable File System Web Server logs for your Azure App Service...

Settings > Diagnostics logs > Web server logging > File System

image

...You'll start to see logs on the file system for your app service here:

(you can find your FTP host and credentials in the publish profile file)

/LogFiles/http/RawLogs

image

Alternatively, you can see these logs through the Kudu UI:

https://{yourappservicename}.scm.azurewebsites.net/DebugConsole/?shell=powershell

image

Instead of downloading these one and a time and parsing through them, you can use this library to assist in loading them into a relational database.

You could even run this as a webjob within your app service.

Setup and Usage

  1. Clone the repo
  2. Create necessary SQL Tables
  3. Set appropriate values in AppSettings.config and ConnectionStrings.config
    • note: The AppSettings.config and ConnectionStrings.config files are referenced by the console application as Linked Files. Update the vaules in the Web project, and after a successful build they will be included in the Console project's build output directory.
  4. Run console application project OR deploy Web Project to Azure Web App/App Service (the console app is defined as a WebJob and will be deployed with the Web project, and is scheduled to run every 15 minutes).

Roadmap

  • currently empty

Other Potentially Helpful Links