TMK.MonitorAndPrefomrance.Core 1.0.7

dotnet add package TMK.MonitorAndPrefomrance.Core --version 1.0.7
                    
NuGet\Install-Package TMK.MonitorAndPrefomrance.Core -Version 1.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TMK.MonitorAndPrefomrance.Core" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TMK.MonitorAndPrefomrance.Core" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="TMK.MonitorAndPrefomrance.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TMK.MonitorAndPrefomrance.Core --version 1.0.7
                    
#r "nuget: TMK.MonitorAndPrefomrance.Core, 1.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TMK.MonitorAndPrefomrance.Core@1.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TMK.MonitorAndPrefomrance.Core&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=TMK.MonitorAndPrefomrance.Core&version=1.0.7
                    
Install as a Cake Tool

مكتبة تمكين الأساسية للمراقبة والأداء

Tamkeen Monitor and Performance Core

نظرة عامة | Overview

مكتبة تمكين الأساسية للمراقبة والأداء هي مكتبة .NET مصممة لتسهيل المراقبة الشاملة وإدارة الأداء داخل تطبيقاتك. تدعم المكتبة التسجيل عبر Serilog مع عدة مخارج، بما في ذلك SQL Server وSeq وElasticsearch، وتوفر معالجة تفصيلية للاستثناءات باستخدام مكتبة StackExchange.Exceptional.

Tamkeen Monitor and Performance Core is a .NET library designed to facilitate comprehensive monitoring and performance management within your applications. The library supports logging via Serilog with various sinks, including SQL Server, Seq, and Elasticsearch, and offers detailed exception handling using the StackExchange.Exceptional library.

المزايا | Features

  • تسجيل مفصل مع Serilog ودعم مخارج متعددة (SQL Server، Seq، Elasticsearch، ملفات)
  • معالجة شاملة للاستثناءات مع StackExchange.Exceptional
  • إعدادات قابلة للتكوين مع دعم متغيرات البيئة وملفات الإعدادات
  • دعم .NET 7+ مع التوافق مع .NET Framework 4.7.2
  • نظام إشعارات عبر البريد الإلكتروني
  • واجهة برمجة تطبيقات عربية مع دعم كامل للغة العربية
  • حقن التبعيات مع Microsoft.Extensions.DependencyInjection
  • التحقق من صحة الإعدادات مع رسائل خطأ واضحة

المتطلبات المسبقة | Prerequisites

  • .NET 7.0+ أو .NET Framework 4.7.2+
  • SQL Server (اختياري للتسجيل في قاعدة البيانات)
  • Seq (اختياري لخادم التسجيل)
  • Elasticsearch (اختياري للبحث والتحليل)

التثبيت | Installation

لتضمين مكتبة تمكين الأساسية للمراقبة والأداء في مشروعك، قم بتشغيل الأمر التالي:

dotnet add package Tamkeen.MonitorAndPerformance.Core

أو عبر Package Manager Console:

Install-Package Tamkeen.MonitorAndPerformance.Core

الإعداد السريع | Quick Setup

1. إضافة الخدمات في Program.cs

using Tamkeen.MonitorAndPerformance.Core.Extensions;

var builder = WebApplication.CreateBuilder(args);

// إضافة خدمات تمكين للمراقبة والأداء
builder.Services.AddTamkeenMonitoring(builder.Configuration);

var app = builder.Build();

2. إعداد ملف appsettings.json

{
  "TamkeenMonitoring": {
    "ProjectName": "مشروع_تمكين_التجريبي",
    "LayerName": "طبقة_الويب",
    "EnvironmentType": 3,
    "Serilog": {
      "Enabled": true,
      "UseConsole": true,
      "FilePath": "./logs/tamkeen-{Date}.log",
      "MinimumLevel": "Information"
    },
    "Exceptions": {
      "Enabled": true,
      "ApplicationName": "تطبيق_تمكين"
    }
  }
}

3. استخدام متغيرات البيئة (موصى به للإنتاج)

export TamkeenMonitoring__ProjectName="مشروع_الإنتاج"
export TamkeenMonitoring__Serilog__DatabaseConnectionString="Server=prod-server;Database=Logs;..."
export TamkeenMonitoring__Elasticsearch__Url="https://elasticsearch.company.com"

جدول الإعدادات | Configuration Reference

الحقل النوع القيمة الافتراضية مطلوب الوصف
ProjectName string - اسم المشروع
LayerName string "Default" اسم الطبقة
EnvironmentType int 3 نوع البيئة (1=إنتاج، 2=اختبار، 3=تطوير)
Serilog.Enabled bool true تفعيل Serilog
Serilog.UseConsole bool true الكتابة إلى وحدة التحكم
Serilog.FilePath string null مسار ملف السجل
Serilog.SeqUrl string null رابط خادم Seq
Serilog.DatabaseConnectionString string null سلسلة الاتصال بقاعدة البيانات
Elasticsearch.Enabled bool false تفعيل Elasticsearch
Elasticsearch.Url string null رابط خادم Elasticsearch
Exceptions.Enabled bool true تفعيل معالجة الاستثناءات
Notifications.EmailEnabled bool false تفعيل إشعارات البريد الإلكتروني

أمثلة الاستخدام | Usage Examples

الاستخدام الأساسي مع Dependency Injection

public class WeatherController : ControllerBase
{
    private readonly ILogger<WeatherController> _logger;
    private readonly IOptions<TamkeenMonitoringOptions> _options;

    public WeatherController(
        ILogger<WeatherController> logger,
        IOptions<TamkeenMonitoringOptions> options)
    {
        _logger = logger;
        _options = options;
    }

    [HttpGet]
    public IActionResult GetWeather()
    {
        _logger.LogInformation("تم طلب بيانات الطقس من {ProjectName}",
            _options.Value.ProjectName);

        // منطق التطبيق هنا
        return Ok(new { Temperature = 25, City = "صنعاء" });
    }
}

الإعداد المخصص

builder.Services.AddTamkeenMonitoring(options =>
{
    options.ProjectName = "مشروع_تمكين_المخصص";
    options.LayerName = "طبقة_الخدمات";
    options.EnvironmentType = 1; // إنتاج

    options.Serilog.Enabled = true;
    options.Serilog.UseConsole = false;
    options.Serilog.FilePath = "/var/log/tamkeen/app.log";

    options.Elasticsearch.Enabled = true;
    options.Elasticsearch.Url = "https://elasticsearch.company.com";
});

سياسة الإصدارات | Versioning Policy

نتبع Semantic Versioning (SemVer):

  • الإصدار الرئيسي (Major): تغييرات غير متوافقة مع الإصدارات السابقة
  • الإصدار الفرعي (Minor): إضافة ميزات جديدة متوافقة
  • إصدار الإصلاح (Patch): إصلاحات الأخطاء

خريطة التوافق

إصدار المكتبة .NET 7 .NET 8 .NET Framework 4.7.2
2.x.x

تشغيل الاختبارات | Running Tests

# تشغيل جميع الاختبارات
dotnet test

# تشغيل الاختبارات مع تقرير التغطية
dotnet test --collect:"XPlat Code Coverage"

# تشغيل اختبارات محددة
dotnet test --filter "Category=Integration"

المساهمة | Contributing

نرحب بالمساهمات في هذا المشروع. يرجى اتباع الخطوات التالية:

  1. Fork المستودع
  2. إنشاء فرع للميزة الجديدة (git checkout -b feature/amazing-feature)
  3. تنفيذ التغييرات مع اختبارات شاملة
  4. التأكد من نجاح جميع الاختبارات
  5. إرسال Pull Request

الترخيص | License

هذا المشروع مرخص تحت رخصة MIT. راجع ملف LICENSE للتفاصيل.

الدعم | Support

للحصول على الدعم والاستفسارات:

  • 📧 البريد الإلكتروني: support@tamkeen.com.ye
  • 🐛 الإبلاغ عن الأخطاء: GitHub Issues
  • 📖 التوثيق: Wiki

مطور بـ ❤️ في اليمن | Made with ❤️ in Yemen

Product 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 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.7 253 9/21/2025