SimpLog 2.1.2

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package SimpLog --version 2.1.2
NuGet\Install-Package SimpLog -Version 2.1.2
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="SimpLog" Version="2.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpLog --version 2.1.2
#r "nuget: SimpLog, 2.1.2"
#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.
// Install SimpLog as a Cake Addin
#addin nuget:?package=SimpLog&version=2.1.2

// Install SimpLog as a Cake Tool
#tool nuget:?package=SimpLog&version=2.1.2

SimpLog NuGet Package

Simple NuGet package to write log files when you need.

Statuses

  1. Trace → This should be used during development to track bugs, but never committed to your VCS.
  2. Debug → log at this level about anything that happens in the program. This is mostly used during debugging, and I’d advocate trimming down the number of debug statement before entering the production stage, so that only the most meaningful entries are left, and can be activated during troubleshooting.
  3. Info → Log at this level all actions that are user-driven, or system specific (ie regularly scheduled operations…)
  4. Notice → This will certainly be the level at which the program will run when in production. Log at this level all the notable events that are not considered an error.
  5. Warn → Log at this level all events that could potentially become an error. For instance if one database call took more than a predefined time, or if an in-memory cache is near capacity. This will allow proper automated alerting, and during troubleshooting will allow to better understand how the system was behaving before the failure.
  6. Error → Log every error condition at this level. That can be API calls that return errors or internal error conditions.
  7. Fatal → Too bad, it’s doomsday. Use this very scarcely, this shouldn’t happen a lot in a real program. Usually logging at this level signifies the end of the program. For instance, if a network daemon can’t bind a network socket, log at this level and exit is the only sensible thing to do.

Configuration in Program.cs

builder.Services.SimpLog();

Configuration in Controller

private readonly ISimpLog _simpLog;

public HomeController( ISimpLog simpLog) { _simpLog = simpLog; }

Use it in Action method

_simpLog.Info("Your message here!", {1}, {2}, {3}, {4}); → This is direct saving and there is no way of loosing data.

{1} → type of recording. Buffer is faster but there can be a little data loss. Standart is directly saving into the log file. {2} → do you want to send email.

{3} and {4} are optional if {1} and {2} are not null!

{3} → path of the log file {4} → name of the log file

If you did not set file name and path then the library won't work. If you set both, the file path and name will be {3} and {4}.

Hope you enjoy the NuGet Package! 😃

appsettings.json example structure for configuring the SimpLog library "SimpLog": { "PathToSaveLogs": "<your path here>", "LogFileName": "<log file name>", "LogType": { "Trace": { "Log": true, "SendEmail": true, "SaveInDatabase": true }, "Debug": { "Log": true, "SendEmail": true, "SaveInDatabase": true }, "Info": { "Log": true, "SendEmail": true, "SaveInDatabase": true }, "Notice": { "Log": true, "SendEmail": true, "SaveInDatabase": true }, "Warn": { "Log": true, "SendEmail": true, "SaveInDatabase": true }, "Error": { "Log": true, "SendEmail": true, "SaveInDatabase": true }, "Fatal": { "Log": true, "SendEmail": true, "SaveInDatabase": true } }, "Email_Configuration": { "SendEmail_Globally": "<disable or enable globally emails>" "Email_From": "<sender email>", "Email_To": "<receiver email>", "Email_BCC": "<blind copy email>", "Email_Connection": { "Host": "<host>", "Port": "<port of the host>", "API_Key": "<api key>", "API_Value": "<api value>" }, "Database_Configuration": { "Connection_String": "<connection string of the desired database>", "Global_Database_Type": "<type of db>", // MSSql / MySql . N.B! Be carefull with spelling! "DateTime_Format": "", // still not working "Global_Enabled_Save": false, "Activate_Migration": false // still not implemented } }

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. 
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
2.2.6 86 4/21/2024
2.2.5 137 3/20/2024
2.2.4 612 11/22/2023
2.2.3 511 10/23/2023
2.2.2 497 10/17/2023
2.2.1 552 9/30/2023
2.2.0 482 9/15/2023
2.1.2 511 8/22/2023
2.1.1 501 7/13/2023
1.1.2 501 6/11/2023
1.1.1 528 3/6/2023
1.1.0 618 3/1/2023
1.0.0 614 1/14/2023
0.0.1-alpha 549 3/29/2022

- removed half of the dependencies