Chd.Library.Logging
7.3.8
See the version list below for details.
dotnet add package Chd.Library.Logging --version 7.3.8
NuGet\Install-Package Chd.Library.Logging -Version 7.3.8
<PackageReference Include="Chd.Library.Logging" Version="7.3.8" />
paket add Chd.Library.Logging --version 7.3.8
#r "nuget: Chd.Library.Logging, 7.3.8"
// Install Chd.Library.Logging as a Cake Addin #addin nuget:?package=Chd.Library.Logging&version=7.3.8 // Install Chd.Library.Logging as a Cake Tool #tool nuget:?package=Chd.Library.Logging&version=7.3.8
Logging library for .Net Core
📝 Table of Contents
🧐 About
I'm computer engineer for 13 years. I wrote this package for logging asp.net core applications. This logging machenism is use aspects for sipmlfy code.
🏁 Getting Started
Logging is an important feature that finding the cause of problem. This package is very simple to use with aspect oriented programming. This library is sink graylog server. You can see logs on graylog run simple step below.
Prerequisites
You must use .net core 6.0 or higher
- Install graylog server.
🔧 Running the tests
[TestClass]
public class CachingTests
{
static CachingTests()
{
LoggingDependencyInjectionExtensions.UseLogger(null);
}
[TestMethod]
public void Test()
{
int a = 4;
Sum(2, 0);
}
[Logged]
public int Sum(int a, int b)
{
//Logger.LogError("hata"); manuel logging.
return a + b;
}
}
You must add below code in appsettings.json
"LogConfig": {
"Server": "192.168.x.x", //required ip for graylog server
"Port": "xxxx", //graylog server port
"Path": "C:\\Logs\\LibrarySampleApp1\\log.txt",
"PathFormat": "C:\\Logs\\LibrarySampleApp1\\log-{Date}.txt",
"ApplicationName": "Library"
},
Test Result
Add break point in to Sum method. You will see only one times broke down into method. Other call is brought from redis server.
🎈 Usage
Firtly you must call UseLogger method ("app.UseLogger();") in the program.cs file. You must use Logged attribute on method whice you want to cache return value of method.
⛏️ Built Using
- Graylog - Graylog server
✍️ Authors
- Mehmet Yoldaş - Linkedin
See also the list of contributors who participated in this project.
🎉 Acknowledgements
Thank you for using my library.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Chd.Library.Common (>= 7.3.9)
- MethodBoundaryAspect.Fody (>= 2.0.149)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.RazorPages (>= 2.2.5)
- Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.2.0)
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.Configuration.CommandLine (>= 7.0.0)
- Microsoft.Extensions.Configuration.Json (>= 7.0.0)
- Microsoft.Extensions.Hosting (>= 7.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Serilog (>= 3.0.1)
- Serilog.Enrichers.Environment (>= 2.2.0)
- Serilog.Settings.Configuration (>= 7.0.0)
- Serilog.Sinks.File (>= 5.0.0)
- Serilog.Sinks.Graylog (>= 3.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Chd.Library.Logging:
Package | Downloads |
---|---|
Chd.Library.Core
The library written for .net core framework |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.1 | 502 | 2/3/2024 |
8.0.0 | 379 | 1/30/2024 |
7.4.1 | 1,022 | 8/25/2023 |
7.4.0 | 584 | 8/18/2023 |
7.3.8 | 671 | 8/9/2023 |
1.3.8 | 466 | 6/15/2023 |
1.3.7 | 531 | 6/13/2023 |
1.3.6 | 505 | 6/13/2023 |
1.3.4 | 462 | 6/13/2023 |
1.3.3 | 689 | 5/28/2023 |
1.3.2 | 693 | 5/8/2023 |
1.3.1 | 452 | 5/8/2023 |
1.3.0 | 699 | 4/28/2023 |
1.2.9 | 460 | 4/28/2023 |
1.2.8 | 1,139 | 2/9/2023 |
1.2.7 | 2,274 | 1/30/2023 |
1.1.9 | 3,011 | 1/30/2023 |