{"id":1546,"date":"2017-06-24T16:08:12","date_gmt":"2017-06-24T13:08:12","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=1546"},"modified":"2019-01-10T11:25:58","modified_gmt":"2019-01-10T08:25:58","slug":"asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/","title":{"rendered":"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log&#8217;lama \u0130\u015flemlerini Merkezile\u015ftirme"},"content":{"rendered":"<p>Selam millet.<\/p>\n<p>ASP.NET Core ile ilgili olan bu 2. serimizde,\u00a0<strong><em>NLog<\/em><\/strong>\u00a0library&#8217;sini kullanarak uygulama i\u00e7erisinde tutmak istedi\u011fimiz \u00e7e\u015fitli log message&#8217;lar\u0131n\u0131,\u00a0<em><strong>GrayLog<\/strong> <\/em>\u00fczerinde tutabilme i\u015flemini ger\u00e7ekle\u015ftirece\u011fiz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1550 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg\" alt=\"\" width=\"750\" height=\"300\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg 750w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog-300x120.jpg 300w\" data-sizes=\"(max-width: 750px) 100vw, 750px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 750px; --smush-placeholder-aspect-ratio: 750\/300;\" \/><\/a><\/p>\n<p>Eminim belki bir \u00e7o\u011fumuz geleneksel .NET Framework \u00fczerinde geli\u015ftirdi\u011fimiz uygulamalarda,\u00a0<em>NLog<\/em> library&#8217;si ile &#8220;<em>NLog.Targets.Gelf<\/em>&#8221; paketini kullanarak, log&#8217;lama i\u015flemlerini <em>GrayLog<\/em> \u00fczerinde ger\u00e7ekle\u015ftirmi\u015fizdir. Bir \u00f6nceki seri olan &#8220;<a href=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/\" target=\"_blank\" rel=\"noopener\"><em>ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services\u2019e Deploy<\/em><\/a>&#8221; makalesinde, bu aralar ASP.NET Core \u00fczerinde \u00e7ok fazla \u00e7al\u0131\u015ft\u0131\u011f\u0131mdan bahsetmi\u015ftim. \u015euanda \u00e7al\u0131\u015ft\u0131\u011f\u0131m firmada yeni geli\u015ftirdi\u011fimiz API&#8217;lar\u0131, ASP.NET Core \u00fczerinde geli\u015ftirmeye \u00e7al\u0131\u015f\u0131yoruz. Bunun yan\u0131nda mevcut .NET stack&#8217;imiz i\u00e7erisindeki t\u00fcm log&#8217;lama i\u015flemlerimizi,\u00a0<em>GrayLog<\/em> \u00fczerinde ger\u00e7ekle\u015ftirerek log&#8217;lama i\u015flemlerini merkezile\u015ftirmi\u015f durumday\u0131z.<\/p>\n<p>K\u0131saca \u00f6neminden bahsetmek gerekirse e\u011fer:<\/p>\n<blockquote><p>Merkezi log&#8217;lama i\u015flemleri \u00f6zellikle son kullan\u0131c\u0131y\u0131 mutlu edebilmek i\u00e7in \u00e7ok \u00f6nemlidir. Ayr\u0131ca sistem performans\u0131n\u0131 s\u00fcrekli iyile\u015ftirebilmek ve hatalar\u0131n h\u0131zl\u0131ca fark\u0131na varabilmek i\u00e7in de \u00e7ok \u00f6nemli oldu\u011fu a\u015fikard\u0131r.<\/p><\/blockquote>\n<p>Her neyse, <strong>ASP.NET Core<\/strong> \u00fczerinde development yaparken farkettim ki,\u00a0<em>NLog<\/em>&#8216;un &#8220;<em>NLog.Targets.Gelf<\/em>&#8221; paketi hen\u00fcz ASP.NET Core ile uyumlu bir hale getirilmemi\u015f (yada ben bulamad\u0131m). Bende bir katk\u0131da bulunabilmek i\u00e7in ilgili kaynak kodu <em>GitHub<\/em> \u00fczerinden fork&#8217;layarak, &#8220;<a href=\"https:\/\/github.com\/GokGokalp\/NLog.Web.AspNetCore.Targets.Gelf\" target=\"_blank\" rel=\"noopener\"><em>NLog.Web.AspNetCore.Targets.Gelf<\/em><\/a>&#8221; ismi alt\u0131nda ASP.NET Core&#8217;a uyumlu bir hale getirdim ve\u00a0<em>NuGet<\/em> server \u00fczerine publish ettim.<\/p>\n<h5>Peki Neden Merkezi Bir Log Sistemine Sahip Olmal\u0131y\u0131z?<\/h5>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/centralized_logging.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1557 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/centralized_logging.png\" alt=\"\" width=\"666\" height=\"279\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/centralized_logging.png 666w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/centralized_logging-300x126.png 300w\" data-sizes=\"(max-width: 666px) 100vw, 666px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 666px; --smush-placeholder-aspect-ratio: 666\/279;\" \/><\/a><\/p>\n<p>G\u00fcn\u00fcm\u00fcz \u00e7a\u011f\u0131nda sabit duran sistemlerden \u00e7ok, <strong>h\u0131zla de\u011fi\u015fen<\/strong> ve ya\u015fayan <strong>dinamik<\/strong> sistemlere sahibiz. Bununla birlikte <strong>da\u011f\u0131t\u0131k<\/strong> ve <strong>otonom<\/strong> bir \u015fekilde ya\u015fayan microservice&#8217;ler, kendini baz\u0131 rule&#8217;lara g\u00f6re dinamik olarak <strong>scale<\/strong> eden yap\u0131larada. Bu ya\u015fayan sistemlerin <strong>s\u00fcrekliliklerini<\/strong> sa\u011flayabilmek i\u00e7in, infrastructure&#8217;da neler olup bitti\u011fini bir noktada biliyor olmam\u0131z laz\u0131m. Bu sayede \u00f6zellikle son kullan\u0131c\u0131y\u0131 mutlu edebilmek i\u00e7in de\u011fi\u015fen uygulamalar\u0131 takip edebilmek, performans\u0131 s\u00fcrekli iyile\u015ftirebilmek ve hatalar kar\u015f\u0131s\u0131nda iz s\u00fcrebilerek h\u0131zl\u0131 aksiyonlar alabilmek m\u00fcmk\u00fcn olmaktad\u0131r. \u00d6zellikle <strong>distributed<\/strong>\u00a0bir \u015fekilde ya\u015fayan sisteme sahipsek ve log yap\u0131lar\u0131m\u0131z\u0131 merkezi bir platform \u00fczerine ta\u015f\u0131rsak, b\u00fct\u00fcn sistem i\u00e7erisinde belirli bir anda herhangi bir aksiyon ger\u00e7ekle\u015fti\u011fi an, tek bir noktadan monitor edebilme i\u015flemi \u00e7ok daha kolay olacakt\u0131r.<\/p>\n<p>Merkezi log y\u00f6netimi i\u015flemini ger\u00e7ekle\u015ftirebilmek i\u00e7in, <em>Splunk,<\/em>\u00a0<em>Graylog<\/em>, <em>Logstash<\/em>, <em>Logwatch<\/em>\u00a0gibi bir \u00e7ok alternarif tool vard\u0131r. Biz bu makale i\u00e7erisinde ise ASP.NET Core application&#8217;\u0131 geli\u015ftirirken, <em>NLog<\/em> library&#8217;si ile log&#8217;lar\u0131m\u0131z\u0131 <em>GrayLog<\/em> i\u00e7erisinde tutabilme i\u015flemini ger\u00e7ekle\u015ftirece\u011fiz.<\/p>\n<h5>Neden GrayLog?<\/h5>\n<ul>\n<li>Her\u015feyden \u00f6nce ba\u015fl\u0131 ba\u015f\u0131na open source bir log y\u00f6netim \u00e7\u00f6z\u00fcm\u00fcd\u00fcr.<\/li>\n<li>Log tutma i\u015flemi i\u00e7in &#8220;<em>Syslog, GELF, TCP, UDP, AMQP<\/em>&#8221; gibi bir \u00e7ok input&#8217;u desteklemektedir.<\/li>\n<li>Message&#8217;lar\u0131 <em>ElasticSearch<\/em>\u00a0\u00fczerinde depolamaktad\u0131r ve buda ar\u015fivler \u00fczerinde h\u0131zl\u0131 aramay\u0131 sa\u011flamaktad\u0131r.<\/li>\n<li>Istatistik i\u015flemleri i\u00e7in ise <em>MongoDB<\/em>&#8216;yi kullanmaktad\u0131r.<\/li>\n<li>Log&#8217;lar\u0131 s\u0131n\u0131fland\u0131rabilmek ve grafiksel i\u015flemler ger\u00e7ekle\u015ftirebilmek m\u00fcmk\u00fcnd\u00fcr.<\/li>\n<li>Istenilen durumlara g\u00f6re\u00a0proactive alert&#8217;lar \u00fcretebilmek kolayd\u0131r.<\/li>\n<\/ul>\n<p>ve dahas\u0131&#8230;<\/p>\n<h5>Docker \u00dczerinde GrayLog Kurulumu<\/h5>\n<p>A\u015fa\u011f\u0131daki &#8220;<strong class=\"final-path\"><em>docker-compose.yml<\/em><\/strong>&#8221; dosyas\u0131n\u0131 kullanarak, <em>GrayLog<\/em>&#8216;u <em>Docker<\/em> \u00fczerinde \u00e7al\u0131\u015ft\u0131raca\u011f\u0131z.<\/p>\n<pre class=\"lang:yaml decode:true \">version: '2'\r\nservices:\r\n  some-mongo:\r\n    image: \"mongo:3\"\r\n  some-elasticsearch:\r\n    image: \"elasticsearch:2\"\r\n    command: \"elasticsearch -Des.cluster.name='graylog'\"\r\n  graylog:\r\n    image: graylog2\/server:2.1.1-1\r\n    environment:\r\n      GRAYLOG_PASSWORD_SECRET: somepasswordpepper\r\n      GRAYLOG_ROOT_PASSWORD_SHA2: 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918\r\n      GRAYLOG_WEB_ENDPOINT_URI: http:\/\/192.168.99.100:9000\/api\r\n    links:\r\n      - some-mongo:mongo\r\n      - some-elasticsearch:elasticsearch\r\n    ports:\r\n      - \"9000:9000\"\r\n      - \"12201:12201\/udp\"\r\n      - \"1514:1514\/udp\"<\/pre>\n<p>Bu i\u015flem i\u00e7in &#8220;<em>aspnetcore-graylog-sample-with-nlog<\/em>&#8221; isminde bir folder olu\u015ftural\u0131m ve &#8220;<em>docker-compose.yml<\/em>&#8221; dosyas\u0131n\u0131, i\u00e7erisine kopyalayal\u0131m. Bu i\u015flemin ard\u0131ndan herhangi bir command tool&#8217;u kullanarak a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">docker-compose up<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/graylog-on-docker.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1562 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/graylog-on-docker.jpg\" alt=\"\" width=\"1388\" height=\"617\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-on-docker.jpg 1388w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-on-docker-300x133.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-on-docker-768x341.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-on-docker-1024x455.jpg 1024w\" data-sizes=\"(max-width: 1388px) 100vw, 1388px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1388px; --smush-placeholder-aspect-ratio: 1388\/617;\" \/><\/a><\/p>\n<p>Bu i\u015flemin ard\u0131ndan <em>GrayLog<\/em> UI&#8217;\u0131na, &#8220;<em>http:\/\/192.168.99.100:9000<\/em>&#8221; bu URL \u00fczerinden eri\u015febiliriz.<\/p>\n<blockquote><p>NOT: Log in i\u015flemi i\u00e7in giri\u015f bilgileri &#8220;admin&#8221;, &#8220;admin&#8221; \u015feklindedir.<\/p><\/blockquote>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/graylog-web-ui.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1563 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/graylog-web-ui.jpg\" alt=\"\" width=\"1522\" height=\"1234\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-web-ui.jpg 1522w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-web-ui-300x243.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-web-ui-768x623.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-web-ui-1024x830.jpg 1024w\" data-sizes=\"(max-width: 1522px) 100vw, 1522px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1522px; --smush-placeholder-aspect-ratio: 1522\/1234;\" \/><\/a><\/p>\n<p><em>GrayLog<\/em> kurulumu neredeyse haz\u0131r. <em>NLog<\/em> ile loglar\u0131 <em>GrayLog<\/em> \u00fczerinde tutabilmemiz i\u00e7in yapmam\u0131z gereken tek bir \u015fey kald\u0131. Log tutabilme i\u015flemi i\u00e7in <em>GrayLog<\/em>&#8216;un, &#8220;<em>GELF<\/em>&#8221; gibi bir \u00e7ok input&#8217;u destekledi\u011finden s\u00f6z etmi\u015ftik. <em>GELF<\/em> input&#8217;unu kullanabilmek i\u00e7in <em>GrayLog<\/em> UI&#8217;\u0131 \u00fczerinden, &#8220;<strong>System \/ Inputs<\/strong> &gt; <strong>Inputs<\/strong>&#8221; men\u00fcs\u00fcne girelim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/graylog-gelf-udp.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1564 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/graylog-gelf-udp.jpg\" alt=\"\" width=\"1522\" height=\"1234\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-gelf-udp.jpg 1522w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-gelf-udp-300x243.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-gelf-udp-768x623.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/graylog-gelf-udp-1024x830.jpg 1024w\" data-sizes=\"(max-width: 1522px) 100vw, 1522px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1522px; --smush-placeholder-aspect-ratio: 1522\/1234;\" \/><\/a>Buradan ise &#8220;<strong>Select input<\/strong>&#8221; drop down men\u00fcs\u00fcnden, &#8220;<em>GELF UDP<\/em>&#8221; se\u00e7ene\u011fini se\u00e7erek &#8220;<strong>Launch new input<\/strong>&#8221; butonuna t\u0131klayal\u0131m. Kar\u015f\u0131m\u0131za \u00e7\u0131kacak olan ekrandan ise, &#8220;<strong>Title<\/strong>&#8221; b\u00f6l\u00fcm\u00fcne herhangi bir isim vererek doldurmam\u0131z yeterli olacakt\u0131r. Art\u0131k &#8220;<em>GELF UDP<\/em>&#8220;, &#8220;<strong>12201<\/strong>&#8221; numaral\u0131 port alt\u0131ndan dinlemeye ba\u015flayacakt\u0131r.<\/p>\n<h5>ASP.NET Core NLog Implementasyonu<\/h5>\n<p><em>GrayLog<\/em> kurulumuna ba\u015flamadan \u00f6nce &#8220;<em>aspnetcore-graylog-sample-with-nlog<\/em>&#8221; isminde bir folder olu\u015fturmu\u015ftuk. Command tool&#8217;u ile tekrardan ayn\u0131 folder i\u00e7erisine gelerek, a\u015fa\u011f\u0131daki gibi bir <em>ASP.NET Core MVC<\/em> projesi olu\u015ftural\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">dotnet new mvc<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/create-aspnetcore-mvc-app.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1568 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/create-aspnetcore-mvc-app.jpg\" alt=\"\" width=\"1388\" height=\"443\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/create-aspnetcore-mvc-app.jpg 1388w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/create-aspnetcore-mvc-app-300x96.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/create-aspnetcore-mvc-app-768x245.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/create-aspnetcore-mvc-app-1024x327.jpg 1024w\" data-sizes=\"(max-width: 1388px) 100vw, 1388px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1388px; --smush-placeholder-aspect-ratio: 1388\/443;\" \/><\/a><\/p>\n<p>Olu\u015fturma i\u015fleminin ard\u0131ndan, <em>Visual Studio Code<\/em> a\u00e7\u0131lacakt\u0131r.<\/p>\n<p>Implementasyon i\u015fleminden \u00f6nce projeye <em>NuGet<\/em> server \u00fczerinden &#8220;<em>NLog.Web.AspNetCore<\/em>&#8221; ve log message&#8217;lar\u0131n\u0131 <em>GrayLog2<\/em>&#8216;ye push yapabilmemiz i\u00e7in gerekli olan &#8220;<em>NLog.Web.AspNetCore.Targets.Gelf<\/em>&#8221; paketini a\u015fa\u011f\u0131daki gibi dahil etmemiz gerekmektedir.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/aspnetcore-nlog.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1570 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/aspnetcore-nlog.jpg\" alt=\"\" width=\"859\" height=\"287\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-nlog.jpg 859w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-nlog-300x100.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-nlog-768x257.jpg 768w\" data-sizes=\"(max-width: 859px) 100vw, 859px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 859px; --smush-placeholder-aspect-ratio: 859\/287;\" \/><\/a><\/p>\n<p>Paketleri projeye dahil ettikten sonra a\u015fa\u011f\u0131daki &#8220;<em>nlog.config<\/em>&#8221; dosyas\u0131n\u0131 projenin root klas\u00f6r\u00fc alt\u0131na koyal\u0131m.<\/p>\n<pre class=\"lang:default decode:true\">&lt;nlog xmlns=\"http:\/\/www.nlog-project.org\/schemas\/NLog.xsd\"\r\n      xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n      autoReload=\"true\"\r\n      throwExceptions=\"false\"\r\n      internalLogLevel=\"Off\"\r\n      internalLogFile=\"c:\\temp\\internal-nlog.txt\"&gt;\r\n  &lt;extensions&gt;\r\n    &lt;add assembly=\"NLog.Web.AspNetCore\"\/&gt;\r\n    &lt;add assembly=\"NLog.Web.AspNetCore.Targets.Gelf\"\/&gt;\r\n  &lt;\/extensions&gt;\r\n  &lt;targets&gt;\r\n    &lt;target xsi:type=\"File\" name=\"errorFile\" filename=\"C:\\@Logs\\${shortdate}-${level}-AspNetCoreTest.txt\" layout=\"${longdate}|${level:upperCase=true}|${logger}|${aspnet-Request-Method}|url: ${aspnet-Request-Url}${aspnet-Request-QueryString}|${message}\" concurrentWrites=\"false\" \/&gt;\r\n    &lt;target xsi:type=\"Gelf\" name=\"graylog\" endpoint=\"udp:\/\/192.168.99.100:12201\" facility=\"console-runner\" SendLastFormatParameter=\"true\" \/&gt;\r\n  &lt;\/targets&gt;\r\n  &lt;rules&gt;\r\n    &lt;logger name=\"*\" minlevel=\"Error\" writeTo=\"errorFile, graylog\" \/&gt;\r\n  &lt;\/rules&gt;\r\n&lt;\/nlog&gt;<\/pre>\n<p>Burada iki adet target&#8217;a sahibiz. Birincisi file&#8217;a log atabilmek i\u00e7in, di\u011feri ise <em>Gelf UDP<\/em> \u00fczerinden message&#8217;lar\u0131 <em>GrayLog2<\/em> \u00fczerinde saklayabilmek i\u00e7in. \u00d6rne\u011fimiz gere\u011fi sadece error message&#8217;lar\u0131n\u0131 log&#8217;layaca\u011f\u0131z.<\/p>\n<p>\u015eimdi &#8220;<em>Startup.cs<\/em>&#8221; i\u00e7erisine girelim ve a\u015fa\u011f\u0131daki gibi <em>NLog\u00a0<\/em>i\u00e7in,\u00a0bir ka\u00e7 sat\u0131r kod ekleyelim.<\/p>\n<pre class=\"lang:c# mark:4,5,7 decode:true\">\/\/ This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\r\npublic void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\r\n{\r\n    loggerFactory.AddNLog();\r\n    app.AddNLogWeb();\r\n\r\n    env.ConfigureNLog(\"nlog.config\");\r\n\r\n    if (env.IsDevelopment())\r\n    {\r\n        app.UseDeveloperExceptionPage();\r\n        app.UseBrowserLink();\r\n    }\r\n    else\r\n    {\r\n        app.UseExceptionHandler(\"\/Home\/Error\");\r\n    }\r\n\r\n    app.UseStaticFiles();\r\n\r\n    app.UseMvc(routes =&gt;\r\n    {\r\n        routes.MapRoute(\r\n            name: \"default\",\r\n            template: \"{controller=Home}\/{action=Index}\/{id?}\");\r\n    });\r\n}<\/pre>\n<p>Yukar\u0131daki kod blo\u011funda, <em>NLog<\/em>&#8216;u\u00a0bir logger olarak kullanaca\u011f\u0131m\u0131z\u0131 belirledik. Hemen ard\u0131ndan ise\u00a0&#8220;<em>nlog.config<\/em>&#8221; file&#8217;\u0131n\u0131n relative path&#8217;ini set ettik. T\u00fcm i\u015flemler bu kadar.<\/p>\n<p>&#8220;<em>HomeController<\/em>&#8221; i\u00e7erisine girelim ve a\u015fa\u011f\u0131daki gibi bir log atal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Logging;\r\n\r\nnamespace aspnetcore_graylog_sample_with_nlog.Controllers\r\n{\r\n    public class HomeController : Controller\r\n    {\r\n        private ILogger _logger;\r\n\r\n        public HomeController(ILogger logger)\r\n        {\r\n            _logger = logger;\r\n        }\r\n        \r\n        public IActionResult Index()\r\n        {\r\n            _logger.LogError(\"Something happened.\");\r\n\r\n            return View();\r\n        }\r\n    }\r\n}<\/pre>\n<p>&#8220;<em>ILogger<\/em>&#8221; interface&#8217;i constructor \u00fczerinden, otomatik olarak ilgili type&#8217;da inject olacakt\u0131r. Buradaki index action&#8217;a bakarsak e\u011fer, action execute olaca\u011f\u0131 zaman &#8220;<em>Something happened.<\/em>&#8221; \u015feklinde bir error message&#8217;\u0131 log&#8217;lad\u0131k.<\/p>\n<p>\u015eimdi projeyi, terminal \u00fczerinden &#8220;<em>dotnet run<\/em>&#8221; komutu ile \u00e7al\u0131\u015ft\u0131ral\u0131m. Projenin \u00e7al\u0131\u015ft\u0131r\u0131lmas\u0131ndan sonra &#8220;<em>http:\/\/localhost:5000<\/em>&#8221; URL&#8217;i \u00fczerinden projeye eri\u015fim sa\u011flayal\u0131m. Buradaki index action&#8217;\u0131 execute edilecektir ve ard\u0131ndan &#8220;<em>C:\\@Logs<\/em>&#8221; path&#8217;i alt\u0131nda a\u015fa\u011f\u0131daki gibi bir log message&#8217;\u0131 tutulacakt\u0131r.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/nlog-file-logged.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1573 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/nlog-file-logged.jpg\" alt=\"\" width=\"1763\" height=\"176\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-file-logged.jpg 1763w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-file-logged-300x30.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-file-logged-768x77.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-file-logged-1024x102.jpg 1024w\" data-sizes=\"(max-width: 1763px) 100vw, 1763px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1763px; --smush-placeholder-aspect-ratio: 1763\/176;\" \/><\/a><\/p>\n<p><em>GrayLog <\/em>UI \u00fczerinden ise &#8220;<strong>System \/ Inputs<\/strong> &gt; <strong>Inputs<\/strong> &gt; <strong>Show received messages<\/strong>&#8221; path&#8217;ini izlersek, <em>GrayLog<\/em> \u00fczerine gelen message&#8217;\u0131 da a\u015fa\u011f\u0131daki gibi g\u00f6rebiliriz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/nlog-graylog-logged.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1574 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/nlog-graylog-logged.jpg\" alt=\"\" width=\"1497\" height=\"539\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-graylog-logged.jpg 1497w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-graylog-logged-300x108.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-graylog-logged-768x277.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/nlog-graylog-logged-1024x369.jpg 1024w\" data-sizes=\"(max-width: 1497px) 100vw, 1497px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1497px; --smush-placeholder-aspect-ratio: 1497\/539;\" \/><\/a><\/p>\n<h5>Sonu\u00e7<\/h5>\n<p>ASP.NET Core \u00fczerinde <em>NLog<\/em> ve <em>NLog&#8217;un GELF<\/em> target&#8217;\u0131n\u0131 (.NET Core i\u00e7in benim transforme etti\u011fim) kullanarak, <em>GrayLog2<\/em> \u00fczerine log atabilme i\u015flemini ger\u00e7ekle\u015ftirdik. Bu makale i\u00e7erisindeki as\u0131l odak noktam\u0131z da buydu. Bunlar\u0131n yan\u0131nda merkezi bir log y\u00f6netim sisteminin de, enterprise seviyedeki projeler i\u00e7in ne denli \u00f6nemli oldu\u011funu tekrardan hat\u0131rlatmak istedim.<\/p>\n<p>Gelecek .NET Core makalelerinde g\u00f6r\u00fc\u015fmek \u00fczere.<\/p>\n<p><em><a href=\"https:\/\/github.com\/GokGokalp\/aspnetcore-graylog-sample-with-nlog\/tree\/master\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/GokGokalp\/aspnetcore-graylog-sample-with-nlog\/tree\/master<\/a><\/em><br \/>\n<em><a href=\"https:\/\/github.com\/GokGokalp\/NLog.Web.AspNetCore.Targets.Gelf\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/GokGokalp\/NLog.Web.AspNetCore.Targets.Gelf<\/a><\/em><\/p>\n<h6>Baz\u0131 Referanslar<\/h6>\n<blockquote><p>https:\/\/github.com\/Graylog2\/graylog-docker<br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/fundamentals\/logging<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Selam millet. ASP.NET Core ile ilgili olan bu 2. serimizde,\u00a0NLog\u00a0library&#8217;sini kullanarak uygulama i\u00e7erisinde tutmak istedi\u011fimiz \u00e7e\u015fitli log message&#8217;lar\u0131n\u0131,\u00a0GrayLog \u00fczerinde tutabilme i\u015flemini ger\u00e7ekle\u015ftirece\u011fiz. Eminim belki bir \u00e7o\u011fumuz geleneksel .NET Framework \u00fczerinde geli\u015ftirdi\u011fimiz uygulamalarda,\u00a0NLog library&#8217;si ile &#8220;NLog.Targets.Gelf&#8221; paketini kullanarak, log&#8217;lama i\u015flemlerini GrayLog \u00fczerinde ger\u00e7ekle\u015ftirmi\u015fizdir. Bir \u00f6nceki seri&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log&#8217;lama \u0130\u015flemlerini Merkezile\u015ftirme<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":1550,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[417,433],"tags":[430,426,427,429,432,425,305,428,431],"class_list":["post-1546","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net-core","category-logging","tag-net-core-graylog","tag-asp-net-core-graylog","tag-asp-net-core-nlog","tag-asp-net-core-nlog-target-gelf","tag-dotnet-core-nlog","tag-graylog","tag-nlog","tag-nlog-target-gelf","tag-nlog-targets-gelf","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":true,"content":true,"excerpt":false}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log&#039;lama \u0130\u015flemlerini Merkezile\u015ftirme - G\u00f6khan G\u00f6kalp<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log&#039;lama \u0130\u015flemlerini Merkezile\u015ftirme - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-24T13:08:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-10T08:25:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log&#8217;lama \u0130\u015flemlerini Merkezile\u015ftirme\",\"datePublished\":\"2017-06-24T13:08:12+00:00\",\"dateModified\":\"2019-01-10T08:25:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/\"},\"wordCount\":2309,\"commentCount\":13,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/asp-net-core-nlog-graylog.jpg\",\"keywords\":[\".net core graylog\",\"asp.net core graylog\",\"asp.net core nlog\",\"asp.net core nlog target gelf\",\"dotnet core nlog\",\"graylog\",\"NLog\",\"nlog target gelf\",\"NLog.Targets.Gelf\"],\"articleSection\":[\"ASP.NET Core\",\"Logging\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/\",\"name\":\"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log'lama \u0130\u015flemlerini Merkezile\u015ftirme - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/asp-net-core-nlog-graylog.jpg\",\"datePublished\":\"2017-06-24T13:08:12+00:00\",\"dateModified\":\"2019-01-10T08:25:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/asp-net-core-nlog-graylog.jpg\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/asp-net-core-nlog-graylog.jpg\",\"width\":750,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET Core Series 02: Log Centralization with using NLog and the GrayLog\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"description\":\"C# &amp; Python lover\",\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gokhan-gokalp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"pronouns\":\"he\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"caption\":\"G\u00f6khan G\u00f6kalp\"},\"logo\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\"},\"sameAs\":[\"https:\\\/\\\/gokhan-gokalp.com\"],\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/tr\\\/author\\\/gok-gokalp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log'lama \u0130\u015flemlerini Merkezile\u015ftirme - G\u00f6khan G\u00f6kalp","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/","og_locale":"tr_TR","og_type":"article","og_title":"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log'lama \u0130\u015flemlerini Merkezile\u015ftirme - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2017-06-24T13:08:12+00:00","article_modified_time":"2019-01-10T08:25:58+00:00","og_image":[{"width":750,"height":300,"url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg","type":"image\/jpeg"}],"author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"14 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log&#8217;lama \u0130\u015flemlerini Merkezile\u015ftirme","datePublished":"2017-06-24T13:08:12+00:00","dateModified":"2019-01-10T08:25:58+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/"},"wordCount":2309,"commentCount":13,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg","keywords":[".net core graylog","asp.net core graylog","asp.net core nlog","asp.net core nlog target gelf","dotnet core nlog","graylog","NLog","nlog target gelf","NLog.Targets.Gelf"],"articleSection":["ASP.NET Core","Logging"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/","url":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/","name":"ASP.NET Core Serisi 02: NLog ve GrayLog Kullanarak Log'lama \u0130\u015flemlerini Merkezile\u015ftirme - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#primaryimage"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg","datePublished":"2017-06-24T13:08:12+00:00","dateModified":"2019-01-10T08:25:58+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#primaryimage","url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-nlog-graylog.jpg","width":750,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-02-nlog-ve-graylog-kullanarak-loglama-islemlerini-merkezilestirme\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"ASP.NET Core Series 02: Log Centralization with using NLog and the GrayLog"}]},{"@type":"WebSite","@id":"https:\/\/gokhan-gokalp.com\/#website","url":"https:\/\/gokhan-gokalp.com\/","name":"G\u00f6khan G\u00f6kalp","description":"C# &amp; Python lover","publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gokhan-gokalp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe","name":"G\u00f6khan G\u00f6kalp","pronouns":"he","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","url":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","caption":"G\u00f6khan G\u00f6kalp"},"logo":{"@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659"},"sameAs":["https:\/\/gokhan-gokalp.com"],"url":"https:\/\/gokhan-gokalp.com\/tr\/author\/gok-gokalp\/"}]}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/comments?post=1546"}],"version-history":[{"count":43,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1546\/revisions"}],"predecessor-version":[{"id":2473,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1546\/revisions\/2473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/1550"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=1546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=1546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=1546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}