Pixelo.Utils.CustomLogger
1.0.6
See the version list below for details.
dotnet add package Pixelo.Utils.CustomLogger --version 1.0.6
NuGet\Install-Package Pixelo.Utils.CustomLogger -Version 1.0.6
<PackageReference Include="Pixelo.Utils.CustomLogger" Version="1.0.6" />
paket add Pixelo.Utils.CustomLogger --version 1.0.6
#r "nuget: Pixelo.Utils.CustomLogger, 1.0.6"
// Install Pixelo.Utils.CustomLogger as a Cake Addin #addin nuget:?package=Pixelo.Utils.CustomLogger&version=1.0.6 // Install Pixelo.Utils.CustomLogger as a Cake Tool #tool nuget:?package=Pixelo.Utils.CustomLogger&version=1.0.6
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
<H1> HOW TO</H1> To set parameters you need to set two things:
you must edit appsettings.json on your WebApi ( this object must insert inside Logging, like this ) :
<br/><br/>
<i><span style="color:gray">
"CustomLogger": { <br/>
"Options": {<br/>
"schemaNameTable": "",<br/>
"ApplicationName": "Design Pattern",<br/>
"ConnectionString": "Data Source=10.0.1.111;Initial Catalog=PragmaticCasino;Persist Security Info=True;User ID=sa;Password=demo!100;",<br/>
"fileOptions": {<br/>
"FilePath": "log_{date}.log",<br/>
"FolderPath": "C:\logs\"<br/>
},<br/>
"MailSetting": {<br/>
"SMTPassword": "SMTPassword",<br/>
"SMTPEnabledSSL": true,<br/>
"SMTPHOST": "SMTPHOST",<br/>
"SMTPMitt": "SMTPMitt",<br/>
"SMTPMittDisplayName": "Design Pattern Alerts",<br/>
"SMTPPORT": 587,<br/>
"SMTPSendEmailTo": "a.chiodo@pixelo.it",<br/>
"xsltPath": "C:\Users\achiodo\Source\Repos\alexbypa\CustomLogger\WebApiTest\xslt\mail.xslt",<br/>
"SecondsCachingBetweenMessagesOnSameApplication": 6<br/>
},<br/>
"telegramOptions": {<br/>
"TotRetry": [<br/>
"00:00:01.0000000",<br/>
"00:00:02.0000000"<br/>
],<br/>
"RateMilliseondsLimit": 500,<br/>
"httpStatusRetry": 503,<br/>
"SecondsCachingBetweenMessagesOnSameApplication": 10,<br/>
"chatId": "55555555555",<br/>
"Api_Key": "387563510:AAENrZ3EOWksWA_5a001xxxxxxxxxxxxxxx"<br/>
},<br/>
"LogLevels": {<br/>
"Information": [<br/>
"SendToFile"<br/>
],<br/>
"Warning":[<br/>
"SendToFile",<br/>
"SendToDB"<br/>
],<br/>
"Error": [<br/>
"SendToFile",<br/>
"SendToDB",<br/>
"SendEmail"<br/>
],<br/>
"Critical": [<br/>
"SendToFile",<br/>
"SendToDB",<br/>
"SendEmail",<br/>
"SendTelegram"<br/>
]<br/>
}<br/>
}<br/>
} <br/>
</span></i>
Add on program.cs this section :
<i><span style="color:gray"> builder.Logging.AddCustomLogger(options ⇒ {<br/> builder<br/> .Configuration<br/> .GetSection("Logging")<br/> .GetSection("CustomLogger")<br/> .GetSection("Options")<br/> .Bind(options);<br/> </span></i>
CONSIDERATIONS
<ul> <li> About param <i><b>SecondsCachingBetweenMessagesOnSameApplication</b></i> this means how many seconds must be wait to send another message to avoid block of the Telegram Bot or SMTP Server </li> <li> To create a Bot telegram is vey simple, you can find an explanation <a href="https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-telegram?view=azure-bot-service-4.0">here</a> </il> </ul>
Product | Versions 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. |
-
net6.0
- Microsoft.Extensions.Caching.Memory (>= 7.0.0)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Polly (>= 7.2.3)
- System.Data.SqlClient (>= 4.8.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Aggiornati i NameSpace