LogDX 1.1.4

SabanciDX ELK Entegrasyonu

Install-Package LogDX -Version 1.1.4
dotnet add package LogDX --version 1.1.4
<PackageReference Include="LogDX" Version="1.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LogDX --version 1.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Log Yazma Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper(
                application: ConfigurationManager.AppSettings["ApplicationName"],
                logApiAddress: ConfigurationManager.AppSettings["LogApiAddress"].ToString(),                           
                indexFormat: ConfigurationManager.AppSettings["ElasticIndexFormat"].ToString()

//API Adresi Yazılmalı. Önemli! Örnek: http://localhost:8083/api/log
//ozer-ws-{0:yyyy.MM.dd});

        _logApiHelper.WriteLogElasticSearch(new LogDX.Models.LogModel
        {
            LogCategory = LogDX.Enums.LogDetail.APP_START,
            LogLevel = LogDX.Enums.LogLevel.Information,
            Type = LogDX.Enums.LogType.ELASTICSEARCH,
            FormData = _logApiHelper.CreateFormDataJObject("Item1=itm1&Item2=itm2"),
            User = _logApiHelper.GetUserName(),
            Ip = "",
            Exception = "",
            FileOverride = false,                               
            URL = "",
            WSInput = "",
            WSOutput = "",                
        });

Api Check Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        var result = _logApiHelper.ApiCheck("http://localhost:8083").Result;
        
        if(result)
        {
            MessageBox.Show("Api çalışıyor.");
        }
        else
        {
            MessageBox.Show("Api çalışmıyor.");
        }

IgnoredFileType Ekleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        _logApiHelper.AddIgnoredFileType("asmx");

IgnoredPath Ekleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        _logApiHelper.AddIgnoredPath("/Tester/Tester/");

IgnoredSubPath Ekleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        _logApiHelper.AddIgnoredSubPath("/Image/");

IgnoredFileType Listeleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        List<string> list = _logApiHelper.ListIgnoredFileType();

IgnoredPath Listeleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        List<string> list = _logApiHelper.ListIgnoredPath();

IgnoredSubPath Listeleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        List<string> list = _logApiHelper.ListIgnoredSubPath();

Config Örneği:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="LogApiAddress" value="http://localhost:8083/api/Log" />
<add key="ElasticIndexFormat" value="tester-{0:yyyy.MM.dd}" />
<add key="ApplicationName" value="Log Tester" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>


Log Yazma Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper(
                application: ConfigurationManager.AppSettings["ApplicationName"],
                logApiAddress: ConfigurationManager.AppSettings["LogApiAddress"].ToString(),                           
                indexFormat: ConfigurationManager.AppSettings["ElasticIndexFormat"].ToString()

//API Adresi Yazılmalı. Önemli! Örnek: http://localhost:8083/api/log
//ozer-ws-{0:yyyy.MM.dd});

        _logApiHelper.WriteLogElasticSearch(new LogDX.Models.LogModel
        {
            LogCategory = LogDX.Enums.LogDetail.APP_START,
            LogLevel = LogDX.Enums.LogLevel.Information,
            Type = LogDX.Enums.LogType.ELASTICSEARCH,
            FormData = _logApiHelper.CreateFormDataJObject("Item1=itm1&Item2=itm2"),
            User = _logApiHelper.GetUserName(),
            Ip = "",
            Exception = "",
            FileOverride = false,                               
            URL = "",
            WSInput = "",
            WSOutput = "",                
        });

Api Check Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        var result = _logApiHelper.ApiCheck("http://localhost:8083").Result;
        
        if(result)
        {
            MessageBox.Show("Api çalışıyor.");
        }
        else
        {
            MessageBox.Show("Api çalışmıyor.");
        }

IgnoredFileType Ekleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        _logApiHelper.AddIgnoredFileType("asmx");

IgnoredPath Ekleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        _logApiHelper.AddIgnoredPath("/Tester/Tester/");

IgnoredSubPath Ekleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        _logApiHelper.AddIgnoredSubPath("/Image/");

IgnoredFileType Listeleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        List<string> list = _logApiHelper.ListIgnoredFileType();

IgnoredPath Listeleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        List<string> list = _logApiHelper.ListIgnoredPath();

IgnoredSubPath Listeleme Örneği:

        LogDX.Helpers.LogApiHelper _logApiHelper = new LogDX.Helpers.LogApiHelper();
        List<string> list = _logApiHelper.ListIgnoredSubPath();

Config Örneği:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="LogApiAddress" value="http://localhost:8083/api/Log" />
<add key="ElasticIndexFormat" value="tester-{0:yyyy.MM.dd}" />
<add key="ApplicationName" value="Log Tester" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Release Notes

SabanciDX ELK Entegrasyonu

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.4 90 5/22/2020