Sending Azure App Service .NET Core Logs to Graylog

Pre-requisites

You’ll need:

Procedure

First, add the following packages to your application:

Next, add the following to Program.cs, at the bottom of the CreateDefaultBuilder method:

Next, configure the appsettings.jsonfile, cleaning the existing Logging config and adding the following:

Do this for the appsettings.Development.json file to allow console logging when in Development:

Verification

Testing the application locally, check to see that you have console logging activated.

Once working, deploy the application to your Azure App Service and verify logs are being sent to Graylog.

To change the Application name, set the “Serilog:Properties:Application” configuration value.