KissLog.AspNet.Web
5.3.1
Prefix Reserved
dotnet add package KissLog.AspNet.Web --version 5.3.1
NuGet\Install-Package KissLog.AspNet.Web -Version 5.3.1
<PackageReference Include="KissLog.AspNet.Web" Version="5.3.1" />
paket add KissLog.AspNet.Web --version 5.3.1
#r "nuget: KissLog.AspNet.Web, 5.3.1"
// Install KissLog.AspNet.Web as a Cake Addin #addin nuget:?package=KissLog.AspNet.Web&version=5.3.1 // Install KissLog.AspNet.Web as a Cake Tool #tool nuget:?package=KissLog.AspNet.Web&version=5.3.1
KissLog
KissLog is the built-in .NET integration for saving the logs to logbee.net.
Check the Wiki page 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.
<table><tr><td> <img alt="logbee.net centralized logging" width="600" src="https://github.com/catalingavan/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;
});
}
Samples
Different use cases and examples can be found on the KissLog integrations page.
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
Product | Versions 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. |
-
.NETFramework 4.6.2
- KissLog (>= 5.3.1)
- KissLog.CloudListeners (>= 5.3.1)
-
.NETFramework 4.7.1
- KissLog (>= 5.3.1)
- KissLog.CloudListeners (>= 5.3.1)
-
.NETFramework 4.8.1
- KissLog (>= 5.3.1)
- KissLog.CloudListeners (>= 5.3.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on KissLog.AspNet.Web:
Package | Downloads |
---|---|
KissLog.AspNet.WebApi
KissLog ASP.NET WebApi package. Install this package on ASP.NET WebApi applications. |
|
KissLog.AspNet.Mvc
KissLog ASP.NET MVC package. Install this package on ASP.NET MVC web applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.