LoggingWrapper 1.1.0
See the version list below for details.
dotnet add package LoggingWrapper --version 1.1.0
NuGet\Install-Package LoggingWrapper -Version 1.1.0
<PackageReference Include="LoggingWrapper" Version="1.1.0" />
<PackageVersion Include="LoggingWrapper" Version="1.1.0" />
<PackageReference Include="LoggingWrapper" />
paket add LoggingWrapper --version 1.1.0
#r "nuget: LoggingWrapper, 1.1.0"
#:package LoggingWrapper@1.1.0
#addin nuget:?package=LoggingWrapper&version=1.1.0
#tool nuget:?package=LoggingWrapper&version=1.1.0
This Package is used to implement Custom Logging in the .net Core Solution.
As per current version i.e. 1.1.0, Serilogging is implemented as custom Logging.
For Implementing Seri Custom logging, Below steps need to be followed
Add Nuget Package i.e LoggingWrapper 1.1.0 from Package Manager console in required projects. PM>Install-Package LoggingWrapper -Version 1.1.0
In the startup project, add following in ConfigureServices method in Startup.cs Class
services.AddScoped<ILogger, SeriLogger>() → This is used for handled logging and Exceptions
services.AddMvc(options ⇒ { options.Filters.Add(new HttpResponseExceptionFilter()); });
-> This is used for Unhandled Exceptions.
Add below configuration in appsettings.json "Serilog": { "Using": [ "Serilog.Sinks.File" ], "MinimumLevel": { "Default": "Verbose"
} }, "LogSettings": { "LogPath": {LogPath}", "fileName": {FileName}, "fileSizeLimitBytes": {FileSizeLimit}, "retainedFileCountLimit": {FileCountLimit} } By Default MinimumLevel Should be Verbose -> Which is used to write all types of logs i.e. Debug/Information/Warning/Error As per project requirement, Minimum Level can be changed to Debug/Information/Warning/Error to log specific logs LogPath-> It is location where you need to store logs. FileName -> It is the name of text file in which logs will be stored.File will be name with mentioned name + [Year(yyyy) + Month(MM) + Day(dd) FileSizeLimit -> It is the no of bytes, a file size should be.If file size increase above the limit, new file will be created with filename_001,filename_002 etc. FileCountLimit -> This field is used to for backup of file for how mnay days.e.g. If 31 days are mentioned in file,after 31 days, all files will be deleted. 1. To use methods for Logging in class file, first import LoggingWrapper namespace 2. Declare variable for ILogger interface (e.g. ILogger logger) 3. Using depedency injecton,initizalize logger variable in constructor. Method for Logging After initizalization,use below methods for logging 1. Debug -> logger.WriteLog(LogType.DEBUG, message); 2. Info -> logger.WriteLog(LogType.Info, message); 3. WARN -> logger.WriteLog(LogType.WARN, message); 4. FATAL -> logger.WriteLog(LogType.FATAL, message); 5. Exception -> logger.WriteError(ex);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.Extensions.Configuration.Json (>= 3.0.0)
- Serilog.AspNetCore (>= 3.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.