Pixelo.Utils.CustomLogger 1.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pixelo.Utils.CustomLogger --version 1.0.7
                    
NuGet\Install-Package Pixelo.Utils.CustomLogger -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="Pixelo.Utils.CustomLogger" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pixelo.Utils.CustomLogger" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Pixelo.Utils.CustomLogger" />
                    
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 Pixelo.Utils.CustomLogger --version 1.0.7
                    
#r "nuget: Pixelo.Utils.CustomLogger, 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 Pixelo.Utils.CustomLogger@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=Pixelo.Utils.CustomLogger&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Pixelo.Utils.CustomLogger&version=1.0.7
                    
Install as a Cake Tool

INTRODUCTION

With this library you can add registry for any activities with 4 different channels :

  • Write on file
  • Write on DB
  • Send Email
  • Send telegram on Bot

HOW TO

To set parameters you need to set two things:

  1. You must edit appsettings.json on your WebApi ( this object must insert inside Logging, like this ) :
"CustomLogger": {
      "Options": {
        "schemaNameTable": "",
        "ApplicationName": "Design Pattern",
        "ConnectionString": "Data Source=10.0.1.111;Initial Catalog=PragmaticCasino;Persist Security Info=True;User ID=sa;Password=demo!100;",
        "fileOptions": {
          "FilePath": "log_{date}.log",
          "FolderPath": "C:\\logs\\"
        },
        "MailSetting": {
          "SMTPassword": "SMTPassword",
          "SMTPEnabledSSL": true,
          "SMTPHOST": "SMTPHOST",
          "SMTPMitt": "SMTPMitt",
          "SMTPMittDisplayName": "Design Pattern Alerts",
          "SMTPPORT": 587,
          "SMTPSendEmailTo": "a.chiodo@pixelo.it",
          "xsltPath": "C:\\Users\\achiodo\\Source\\Repos\\alexbypa\\CustomLogger\\WebApiTest\\xslt\\mail.xslt",
          "SecondsCachingBetweenMessagesOnSameApplication": 6
        },
        "telegramOptions": {
          "TotRetry": [
            "00:00:01.0000000",
            "00:00:02.0000000"
          ],
          "RateMilliseondsLimit": 500,
          "httpStatusRetry": 503,
          "SecondsCachingBetweenMessagesOnSameApplication": 10,
          "chatId": "55555555555",
          "Api_Key": "387563510:AAENrZ3EOWksWA_5a001xxxxxxxxxxxxxxx"
        },
        "LogLevels": {
          "Information": [
            "SendToFile"
          ],
          "Warning": [
            "SendToFile",
            "SendToDB"
          ],
          "Error": [
            "SendToFile",
            "SendToDB",
            "SendEmail"
          ],
          "Critical": [
            "SendToFile",
            "SendToDB",
            "SendEmail",
            "SendTelegram"
          ]
        }
      }
    }

Add on program.cs this section :

builder.Logging.AddCustomLogger(options => {
builder
	.Configuration
	.GetSection("Logging")	
	.GetSection("CustomLogger")
	.GetSection("Options")
	.Bind(options);

CONSIDERATIONS

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.  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. 
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.9 381 1/3/2023
1.0.8 326 12/30/2022
1.0.7 326 12/29/2022
1.0.6 347 12/29/2022
1.0.5 355 12/28/2022
1.0.4 333 12/27/2022
1.0.3 316 12/27/2022
1.0.2 332 11/16/2022
1.0.0 348 11/16/2022

Aggiornati i NameSpace