ASP.NET Core 3.0 Web Uygulamasında NLog Kullanarak Günlük Kaydını Tümleştirme

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
<?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" throwExceptions="false" internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log"> <targets> <target xsi:type="File" name="fileTarget" filename="..\logs\log.txt"></target> </targets> <rules> <logger name="*" minlevel="Trace" writeTo="fileTarget" /> </rules> </nlog>
Image for post
Image for post
Image for post
Image for post
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureLogging((hostingContext, logging) => { logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); logging.AddDebug(); logging.AddNLog(); }) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
Image for post
Image for post

Written by

Bilgisayar Müh. Digidea Dijital Hizmetler Ltd. Şti. #NetCore #Angular #Vue #Codeigniter

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store