This repository contains a .NET project set up with Serilog for logging, integrated with Azure Application Insights for centralized logging and monitoring.
To get started with this project, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/Ascentic/dotnet-serilog-with-azure-app-insight.git
-
Navigate to the project directory:
cd dotnet-serilog-with-azure-app-insight
-
Update
appsettings.json
:Update the
appsettings.json
file with your Azure Application Insights Instrumentation Key and Connection String. You can find placeholdersYOUR_INSTRUMENTATION_KEY
andYOUR_CONNECTION_STRING
in the file."IsUseDefaultLogger": false, "APPINSIGHTS_INSTRUMENTATIONKEY": "xxxxxxxx-b05a-41ed-a8ed-xxxxxxxxxx", "APPLICATIONINSIGHTS_CONNECTION_STRING": "InstrumentationKey=xxxxxx-b05a-41ed-a8ed-xxxxxxxx;IngestionEndpoint=https://xxxxxxxxxx-0.in.applicationinsights.azure.com/;LiveEndpoint=https://xxxxxxxxxx.livediagnostics.monitor.azure.com/" }
-
Build and run the application:
dotnet build dotnet run
-
Visit
https://localhost:7085/swagger/index.html
in your web browser access the API.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.