Showing posts with label NLog. Show all posts
Showing posts with label NLog. Show all posts

Wednesday, August 21, 2019

Logging with NLog

Here are some links and tips & tricks for nLog nuget extension. Find how to work with it and additionally there are some tips to make some more change in its configuration to achieve specific needs.

ASP.NET Core Web API – Logging With NLog

Introduction to NLog

NLog: Rules and filters

- To check with configuration of file
Configuration file

- To working from code base
Configure from code

Things your Dad never told you about NLog

- Tips & Tricks
Turn off Logging during Release from Nlog.config

How to turn ON and OFF logging for specific levels in NLog

how to disable the particular log, dynamically in Nlog using C#?

- Additionally
(1) To log only Info message

<logger name="*" minlevel="Info" maxlevel="Info" writeTo="logfile" />

or

<logger levels="Info" name="*" writeTo="logfile"/>

(2) To log multiple message, below change will log messages for Error and Info and that way we can add other too
<logger levels="Info,Error" name="*" writeTo="logfile"/>

(3) To disable logging set enable to false
<logger name="*" minlevel="Debug" writeTo="logfile"  enabled="false" /
>

Wednesday, July 17, 2019

Useful NugGet Packages

Here are some useful NuGet packages that you would love to include while creating any Dot NET CORE API.

(1) gzip - Compression
Microsoft.AspNetCore.ResponseCompression
- How to enable gzip compression in ASP.NET Core


(2) swagger
Swashbuckle.AspNetCore
Swagger UI Integration With Web API For Testing And Documentation
ASP.NET Core web API help pages with Swagger / OpenAPI

(3) IP Rate Limiter
Install-Package AspNetCoreRateLimit
Rate limiting based on client IP
IpRateLimitMiddleware


(4) Logging with NLog
- ASP.NET Core Web API – Logging With NLog

(5) Firebase: To work with firebase push notifications
Install-Package FirebaseAdmin