{"id":1896,"date":"2023-06-15T09:14:51","date_gmt":"2023-06-15T09:14:51","guid":{"rendered":"http:\/\/waqar-arshad.com\/?p=1896"},"modified":"2023-06-15T09:14:51","modified_gmt":"2023-06-15T09:14:51","slug":"nlog-logging-fundamental","status":"publish","type":"post","link":"http:\/\/waqar-arshad.com\/index.php\/2023\/06\/15\/nlog-logging-fundamental\/","title":{"rendered":"NLog &#8211; Logging Fundamental"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"1896\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"1896\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-down\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>\n<p><strong>What is Nlog ?<\/strong><\/p>\n\n\n\n<p>Nlog is an open source log platform. Through this platform, we can log an activity of an application. This makes an application&#8217;s code easy to handle. Nlog provides a cross platform support.<\/p>\n\n\n\n<p><strong>Things we can log<\/strong><\/p>\n\n\n\n<p>By using Nlog in an Application, we can log the things given below.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Trace &#8211; Detailed Log<\/li>\n\n\n\n<li>Debug &#8211; Debugging Information<\/li>\n\n\n\n<li>Info &#8211; Info Message<\/li>\n\n\n\n<li>Warning &#8211; Warning Messages<\/li>\n\n\n\n<li>Error &#8211; Error Messages<\/li>\n\n\n\n<li>Fatal &#8211; Big Errors, which needs attention<\/li>\n<\/ul>\n\n\n\n<p><strong>Basic Targets<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Files-&nbsp;<\/em>We can log our messages into a file.<\/li>\n\n\n\n<li><em>Database<\/em>&nbsp;can also work with SQL Server, using Nlog.<\/li>\n\n\n\n<li><em>Console&nbsp;<\/em>displays messages in a C# Console Application.<\/li>\n\n\n\n<li><em>Email-&nbsp;<\/em>We can email log message.<\/li>\n<\/ul>\n\n\n\n<p>Today, we will create a console Application and will use Nlog for the things given below.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To display log messages in a console application.<\/li>\n\n\n\n<li>Log messages in a file at a specified location.<\/li>\n\n\n\n<li>Also, we will email a logged message.<\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s start.<\/p>\n\n\n\n<p><strong>Step 1<\/strong><br><br>Create a C# console Application and name it NlogDemoApplication.<br><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"403\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-56.png\" alt=\"\" class=\"wp-image-1897\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-56.png 666w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-56-300x182.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/figure>\n\n\n\n<p><strong>Step 2<\/strong><br><br>Install Nlog package in the Application. You can use NuGet Package Manager for this. Use the command given below.<\/p>\n\n\n\n<p><em>Install-Package NLog.Config<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"502\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-57.png\" alt=\"\" class=\"wp-image-1898\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-57.png 940w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-57-300x160.png 300w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-57-768x410.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p>Two files will be added, as shown below.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>Config<\/li>\n\n\n\n<li>xsd<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"375\" height=\"584\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-58.png\" alt=\"\" class=\"wp-image-1899\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-58.png 375w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-58-193x300.png 193w\" sizes=\"auto, (max-width: 375px) 100vw, 375px\" \/><\/figure>\n\n\n\n<p><strong>Step 3<\/strong><br><br>Open Program.cs file and create a private static Logger per class. We also need to use LogManager to create Logger instances. Do not forget to add namespace as well.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li><strong>private<\/strong>&nbsp;<strong>static<\/strong>&nbsp;Logger&nbsp;logger&nbsp;=&nbsp;LogManager.GetCurrentClassLogger(); &nbsp;<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"481\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-59.png\" alt=\"\" class=\"wp-image-1900\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-59.png 940w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-59-300x154.png 300w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-59-768x393.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p><strong>Step 4<\/strong><br><br>Replace the main function with the code given below. In this method, we just call Nlog error function to log a static error message.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li><strong>static<\/strong>&nbsp;<strong>void<\/strong>&nbsp;Main(string[]&nbsp;args)&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logger.Error(&#8220;This&nbsp;is&nbsp;an&nbsp;error&nbsp;message&#8221;);&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.Read();&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p><strong>Step 5<\/strong><br><br>Now, open Nlog.Confile and replace code given below as well.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>&lt;targets&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&lt;target&nbsp;name=&#8221;console&#8221;&nbsp;xsi:type=&#8221;Console&#8221;&nbsp;layout=&#8221;${longdate}|${message}&#8221;\/&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&lt;\/targets&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;<\/li>\n\n\n\n<li>&lt;rules&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&lt;logger&nbsp;name=&#8221;*&#8221;&nbsp;minlevel=&#8221;Error&#8221;&nbsp;writeTo=&#8221;console&#8221;&nbsp;\/&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&lt;\/rules&gt;&nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Under targets tag, we add keys as targets; i.e. where we want the results and under rules tag and we add key (rules), when we write our log. In the meantime, we are going to target a console Application and we are going to write a log whenever an error will occur.<\/p>\n\n\n\n<p><strong><u>Note<\/u><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>xsitype&nbsp;<\/em>Type of target for log<\/li>\n\n\n\n<li><em>Layout&nbsp;<\/em>Output<\/li>\n\n\n\n<li><em>Name&nbsp;<\/em>name of the target<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 6<\/strong><br><br>Run the Console Application and you will see the output given below. This is how we display a log message to a console output Window<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"449\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-60.png\" alt=\"\" class=\"wp-image-1901\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-60.png 845w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-60-300x159.png 300w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-60-768x408.png 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/figure>\n\n\n\n<p><strong>Step 7<\/strong><br><br>Now, we going to target a file to log an error message. Again, open Nlog.Config file and add line given below under targets tag.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>&lt;target&nbsp;name=&#8221;file&#8221;&nbsp;xsitype=&#8221;File&#8221;&nbsp;fileName=&#8221;D\\logs\\NLog.log&#8221;&nbsp;layout=&#8221;${longdate}|${message}&#8221;\/&gt; &nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>In the existing rule, add the file (name of the target) with the console. Now, your code will look like, as shown below.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>&lt;targets&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&lt;target&nbsp;name=&#8221;console&#8221;&nbsp;xsitype=&#8221;Console&#8221;&nbsp;layout=&#8221;${longdate}|${message}&#8221;\/&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;target&nbsp;name=&#8221;file&#8221;&nbsp;xsitype=&#8221;File&#8221;&nbsp;fileName=&#8221;D\\logs\\NLog.log&#8221;&nbsp;layout=&#8221;${longdate}|${message}&#8221;\/&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&lt;\/targets&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&lt;rules&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&lt;logger&nbsp;name=&#8221;*&#8221;&nbsp;minlevel=&#8221;Error&#8221;&nbsp;writeTo=&#8221;console,file&#8221;&nbsp;\/&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&lt;\/rules&gt;&nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p><strong>Step 8<\/strong><br><br>Run the code. Now, you will see the output in two places, where one is in console Window and the second is in the target file. Check the path specified in the file target. See the image given below for the reference.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"529\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-61.png\" alt=\"\" class=\"wp-image-1902\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-61.png 940w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-61-300x169.png 300w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-61-768x432.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p><strong>Step 9<\/strong><br><br>We are going to target an email now. Again, add one more target (as shown below) under targets tag.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Type<\/strong><\/td><td><strong>Mail<\/strong><\/td><\/tr><tr><td>Subject<\/td><td>Could be whatever you want<\/td><\/tr><tr><td>To<\/td><td>To whom you will send email<\/td><\/tr><tr><td>From<\/td><td>Sending of email<\/td><\/tr><tr><td>Body<\/td><td>layout (Message you want to display &nbsp;in email)<\/td><\/tr><tr><td>enableSSl<\/td><td>For secure email<\/td><\/tr><tr><td>SmtpAuthentication<\/td><td>(None, Basic, Ntlm)<\/td><\/tr><tr><td>SmtpUserName<\/td><td>Username (from email)<\/td><\/tr><tr><td>SmtpPassword<\/td><td>Password (From email)<\/td><\/tr><tr><td>SmtpServer<\/td><td>Server from which you want to send the email.<\/td><\/tr><tr><td>Smptport<\/td><td>As per servers<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>We are using basic authentication, so we have to mention smtpusername and password.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>&lt;target&nbsp;name=&#8221;sendMail&#8221;&nbsp;xsitype=&#8221;Mail&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subject=&#8221;Application&nbsp;Error&nbsp;Log&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to=&#8221;XXXXXXXXXXXXXXXXXXXXXXXXXXX&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from=&#8221;XXXXXXXXXXXXXXXXXXXXXXXXX&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body=&#8221;${longdate}|${message}&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enableSsl=&#8221;true&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;smtpAuthentication=&#8221;Basic&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;smtpServer=&#8221;smtp.gmail.com&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;smtpUserName=&#8221;XXXXXXXXXXXXXXXXXXXX&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;smtpPassword=&#8221;XXXXXXXXXXXXXXXXXXXX&#8221;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;smtpPort=&#8221;587&#8243;\/&gt;&nbsp;&nbsp;<\/li>\n\n\n\n<li>&nbsp;&nbsp;&lt;\/targets&gt;&nbsp;&nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>The name of the target, which is sendEmail and the existing rule is shown below.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\">\n<li>&lt;logger&nbsp;name=&#8221;*&#8221;&nbsp;minlevel=&#8221;Error&#8221;&nbsp;writeTo=&#8221;console,file,sendMail&#8221;&nbsp;\/&gt; &nbsp;&nbsp;<\/li>\n<\/ol>\n\n\n\n<p><strong>Step 10<\/strong><\/p>\n\n\n\n<p>Run the application. In my case, I see the output, as shown below. You can check the result on your specified email address, when you try this code.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"370\" src=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-62.png\" alt=\"\" class=\"wp-image-1903\" srcset=\"http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-62.png 803w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-62-300x138.png 300w, http:\/\/waqar-arshad.com\/wp-content\/uploads\/2023\/06\/image-62-768x354.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/figure>\n\n\n\n<p><br>Thus, you can check the log messages now at three places<br><br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Console<\/li>\n\n\n\n<li>File<\/li>\n\n\n\n<li>email<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>What is Nlog ? Nlog is an open source log platform. Through this platform, we can log an activity of an application. This makes an application&#8217;s code easy to handle. Nlog provides a cross platform support. Things we can log By using Nlog in an Application, we can log the things given below. Basic Targets [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12,13,11],"tags":[],"class_list":["post-1896","post","type-post","status-publish","format-standard","hentry","category-asp-net","category-asp-net-core","category-csharp"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"http:\/\/waqar-arshad.com\/index.php\/author\/waqar_29_1\/"},"uagb_comment_info":22,"uagb_excerpt":"What is Nlog ? Nlog is an open source log platform. Through this platform, we can log an activity of an application. This makes an application&#8217;s code easy to handle. Nlog provides a cross platform support. Things we can log By using Nlog in an Application, we can log the things given below. Basic Targets&hellip;","_links":{"self":[{"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/posts\/1896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/comments?post=1896"}],"version-history":[{"count":1,"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/posts\/1896\/revisions"}],"predecessor-version":[{"id":1904,"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/posts\/1896\/revisions\/1904"}],"wp:attachment":[{"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/media?parent=1896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/categories?post=1896"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/waqar-arshad.com\/index.php\/wp-json\/wp\/v2\/tags?post=1896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}