AKS.Sql.Logger

Logs application events into a SQL database ----------------------------------------------------------------------- Create this table in your SQL database: CREATE TABLE Logs ( Id INT IDENTITY(1,1) PRIMARY KEY, Timestamp DATETIME, LogLevel NVARCHAR(50), Category NVARCHAR(100), Message NVARCHAR(MAX), Exception NVARCHAR(MAX) null ); Use It in a .NET App using Microsoft.Extensions.Logging; using AKS.Sql.Logger; AKSSqlLogger aKSSqlLogger = new AKSSqlLogger(categoryName, "Server=<Server_Name></Server_Name>;Database=<DBNAME></DBNAME>;Trusted_Connection=True;TrustServerCertificate=True;"); try { aKSSqlLogger.Log(LogLevel.Information, "Record is saved successfully"); } catch (Exception ex) { aKSSqlLogger.LogException(LogLevel.Error, ex); } This version exposes two method. one to capture Log and another to capture Exception. Easy to use in .net app.


Keywords
Install
Install-Package AKS.Sql.Logger -Version 1.1.5