Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/odeyabdulrahman/distributed.logging
Distributed Logging
https://github.com/odeyabdulrahman/distributed.logging
elsticsearch kibana logger-middleware logging-library microservices serilog
Last synced: 1 day ago
JSON representation
Distributed Logging
- Host: GitHub
- URL: https://github.com/odeyabdulrahman/distributed.logging
- Owner: odeyAbdulrahman
- License: mit
- Created: 2022-11-19T13:42:40.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-15T19:38:12.000Z (over 1 year ago)
- Last Synced: 2024-11-12T00:12:08.933Z (2 months ago)
- Topics: elsticsearch, kibana, logger-middleware, logging-library, microservices, serilog
- Language: C#
- Homepage: https://medium.com/@odey.abdalrahman/distributed-logging-with-elasticsearch-and-kibana-d0fb26dd2cc3
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Distributed Logging with Elasticsearch and Kibana
![Logo](https://i.postimg.cc/WbS5ny0q/2125009.png)
Did you know that up to 30% of software development time is spent debugging code? In this article, we'll show you how to save time and effort by automating the error-catching process and logging errors to Elasticsearch.
Elasticsearch is a distributed, free and open search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured. And through it, you can store logs of other types, according to your needs in the project. This powerful tool allows you to easily view and analyze system-level errors later on Kibana, a free and open user interface that lets you visualize your Elasticsearch data and navigate the Elastic Stack.
Kibana lets you do anything from tracking query load to understanding the way requests flow through your apps. To enable logging with Elasticsearch in .NET, we'll be using Serilog, a plugin which provides diagnostics logging to files, console, and elsewhere. Various sinks are available for Serilog which we can set up easily has a clean API.## How to use:
After adding the library to our project, we have to follow the following steps:1 - We will add some lines to Program.cs
```javascript
using Distributed.Logging.Utilities;var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureAppConfiguration((hostingContext, config) =>
{
config.AddEnvironmentVariables();
}).UseSerilog(SeriLoggerUtility.Configure);
var app = builder.Build();
app.UseMiddleware();
app.Run();
```
2 - add Elastic URL in appseting.json .
```javascript
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"System": "Warning"
}
}
},
"ElasticConfiguration": {
"Uri": "http://localhost:9200"
}
}
```