KissLog.AspNet.WebApi 5.2.0

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

// Install KissLog.AspNet.WebApi as a Cake Tool
#tool nuget:?package=KissLog.AspNet.WebApi&version=5.2.0

KissLog

Latest version Downloads

KissLog is the built-in .NET integration for saving the logs to logBee.net.

Check the documentation for a complete list of features.

.NET support

Why KissLog?

KissLog implements three main components: logging functionality, exceptions tracking and application insights.

For web applications, KissLog automatically captures all the HTTP properties.

KissLog keeps the log events in memory and sends them to the registered listeners all at once. This can help reduce the load of the persistence implementation (such as Disk I/O, database operations or network throughput).

Centralized logging using logBee.net or logBee on-premises app.

<table><tr><td> <img alt="logBee.net centralized logging" width="600" src="https://github.com/KissLog-net/KissLog.Sdk/assets/39127098/583ff625-d0ce-4ebc-b0d7-9a3b0257d3ef" /> </td></tr></table>

Basic usage

using KissLog;
using KissLog.Listeners.FileListener;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            KissLogConfiguration.Listeners
                .Add(new LocalTextFileListener("logs", FlushTrigger.OnFlush));

            var logger = new Logger();

            logger.Trace("Hey, I am a log message");

            Logger.NotifyListeners(logger);
        }
    }
}

Saving the logs

KissLog saves the logs to multiple output locations by using log listeners.

Log listeners are registered at application startup using the KissLogConfiguration.Listeners container.

Custom log listeners can be easily implemented.

Using interceptors, log listeners can apply conditional filtering rules before saving the events.

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            KissLogConfiguration.Listeners
                .Add(new LocalTextFileListener("logs", FlushTrigger.OnMessage))
                .Add(new CustomMongoDbListener("mongodb://localhost:27017", "Logs")
                {
                    Interceptor = new LogLevelInterceptor(LogLevel.Information)
                });

            var logger = new Logger();
            logger.Trace("Hey, I am a log message");

            Logger.NotifyListeners(logger);
        }
    }
}

Configuration

KissLog supports various configuration options using the KissLogConfiguration.Options configuration object.

private void ConfigureKissLog
{
    KissLogConfiguration.Options
        .AppendExceptionDetails((Exception ex) =>
        {
            if (ex is DivideByZeroException zeroDivisionEx)
                return ">>> Should check if the denominator is zero before dividing";

            return null;
        });
}

AppendExceptionDetails

Samples

Check the test applications for more examples of using KissLog.

Feedback

Please use the issues section to report bugs, suggestions and general feedback.

Contributing

All contributions are very welcomed: code, documentation, samples, bug reports, feature requests.

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 is compatible.  net472 was computed.  net48 was computed.  net481 is compatible. 
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
5.2.0 0 5/3/2024
5.1.2 1,111 5/2/2022
5.1.1 790 12/27/2021
5.1.0 765 12/26/2021
5.0.0 802 11/6/2021
4.2.0 883 8/6/2021
4.1.0 1,153 1/31/2021
4.0.0 1,363 9/21/2020
3.5.6 1,607 3/3/2020
3.5.5 1,231 12/13/2019
3.5.4 1,140 11/22/2019
3.5.3 1,070 11/22/2019
3.5.2 1,096 11/11/2019
3.5.1 1,142 10/16/2019
3.5.0 1,075 10/12/2019
3.4.1 1,138 9/26/2019
3.4.0 1,191 7/5/2019
3.2.1 1,137 6/19/2019
3.2.0 1,148 5/19/2019
3.1.1 1,221 3/27/2019
3.1.0 1,111 3/26/2019
3.0.0 1,164 3/15/2019
2.2.0 1,325 11/13/2018
2.1.0 1,304 11/7/2018
2.0.0 1,355 10/20/2018
1.5.10 1,396 8/14/2018
1.5.9 1,413 8/13/2018
1.5.8 1,366 8/11/2018
1.5.7 1,442 7/25/2018
1.5.6 1,317 7/25/2018
1.5.5 1,416 7/25/2018
1.5.4 1,523 6/12/2018
1.5.3 1,544 6/5/2018
1.5.2 1,574 5/15/2018
1.5.1 1,746 5/15/2018
1.5.0 1,547 5/9/2018
1.4.6 1,506 5/7/2018
1.4.5 1,545 5/4/2018
1.4.4 1,674 4/27/2018
1.4.3 1,557 4/27/2018
1.4.2 1,541 4/27/2018
1.4.1 1,487 4/26/2018
1.4.0 1,632 4/13/2018
1.3.6 1,510 2/25/2018
1.3.5 1,548 2/25/2018
1.3.4 1,551 11/18/2017
1.3.3 1,464 11/17/2017
1.3.2 1,415 11/17/2017
1.3.1 1,493 11/14/2017
1.3.0 1,527 11/13/2017
1.2.3 1,419 11/10/2017
1.2.2 1,524 10/28/2017
1.2.1 1,400 10/25/2017
1.2.0 1,464 10/25/2017
1.1.1 1,491 9/6/2017
1.1.0 1,454 8/25/2017
1.0.1 1,468 8/22/2017
1.0.0 1,521 8/22/2017