Then, in which ever file you want to do logging, do like this (in my example, I am showing in Program.cs file) using System With $ in the file name, it will automatically make a new logfile everyday. Step 2) Step 1 will add a file called nfig (we don’t modify another NLog.xsd file). Our goal is to set a new log file each day with date in it’s name and email notifications in case of warnings and (fatal) errors. This will automatically install other dependencies like NLog and NLog.Schema. Step 1) Install NLog.Config through Nuget package manager. Scenario is that we have multiple projects in our solution. log4Net looked like more of XML configuration. Two options came standard NLog or log4Net. Recently, I was working on an enterprise project using Windows Forms and needed a logger that was thread-safe, allowed both structured and text based logging and provided an options to integrate email sending as well.
0 Comments
Leave a Reply. |