{"action":"created","issue":{"url":"https://api.github.com/repos/NLog/NLog/issues/1071","labels_url":"https://api.github.com/repos/NLog/NLog/issues/1071/labels{/name}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/1071/comments","events_url":"https://api.github.com/repos/NLog/NLog/issues/1071/events","html_url":"https://github.com/NLog/NLog/issues/1071","id":120295547,"number":1071,"title":"[Nlog Performance Issue]","user":{"login":"varunkumarmnnit","id":8800255,"avatar_url":"https://avatars.githubusercontent.com/u/8800255?v=3","gravatar_id":"","url":"https://api.github.com/users/varunkumarmnnit","html_url":"https://github.com/varunkumarmnnit","followers_url":"https://api.github.com/users/varunkumarmnnit/followers","following_url":"https://api.github.com/users/varunkumarmnnit/following{/other_user}","gists_url":"https://api.github.com/users/varunkumarmnnit/gists{/gist_id}","starred_url":"https://api.github.com/users/varunkumarmnnit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunkumarmnnit/subscriptions","organizations_url":"https://api.github.com/users/varunkumarmnnit/orgs","repos_url":"https://api.github.com/users/varunkumarmnnit/repos","events_url":"https://api.github.com/users/varunkumarmnnit/events{/privacy}","received_events_url":"https://api.github.com/users/varunkumarmnnit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NLog/NLog/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/NLog/NLog/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2015-12-03T23:23:51Z","updated_at":"2015-12-04T22:29:33Z","closed_at":null,"body":"Hello I have recently started using Nlog .I am getting a serious performance issue with Nlog .Bleow is my code \r\nProgramm.cs \r\n\r\n```c#\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Data.SqlTypes;\r\nusing System.Diagnostics;\r\nusing System.Linq;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Security.Cryptography.X509Certificates;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing NLog;\r\nusing NLog.Common;\r\nusing NLog.Targets;\r\nusing NLog.Targets.Wrappers;\r\n\r\nnamespace NLogTest\r\n{\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            \r\n            Stopwatch sw = Stopwatch.StartNew();\r\n            TestLoggerHierarchy();\r\n            sw.Stop();\r\n            Console.WriteLine(\"Time taken: {0}ms\", sw.Elapsed.TotalMilliseconds);\r\n            \r\n        }\r\n\r\n        \r\n\r\n        private static void TestLoggerHierarchy()\r\n        {\r\n            for (var i = 0; i < 1; i++)\r\n            {\r\n                string jobId = System.Guid.NewGuid().ToString();\r\n                NLog.GlobalDiagnosticsContext.Set(\"jobId\", jobId);\r\n              \r\n           \r\n              ILogger mipLogger = LogManager.GetLogger(\"mipLogger\");\r\n              \r\n                mipLogger.Info(\"MIP Started\");\r\n       \r\n                for (var line = 0; line < (10000000 + (i * 100)); line++)\r\n                {\r\n                    mipLogger.Info(\"MIP : \" + line);\r\n                }\r\n\r\n                mipLogger.Info(\"MIP Finished\");\r\n            \r\n            }\r\n        }\r\n\r\n\r\n   \r\n    }\r\n}\r\n```\r\n\r\nApp.config\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<configuration>\r\n  <configSections>\r\n    <section name=\"nlog\" type=\"NLog.Config.ConfigSectionHandler, NLog\"/>\r\n  </configSections>\r\n  <nlog xmlns=\"http://nlog-project.org/schemas/NLog.xsd\"\r\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n    <extensions>\r\n        <add assembly =\"NLogTest\"/>\r\n    </extensions>\r\n    <targets async=\"true\">      \r\n  \r\n         <target name=\"asyncWrapper\" xsi:type=\"AsyncWrapper\"   overflowAction=\"Discard\" queueLimit=\"1000000\" batchSize=\"1000\" timeToSleepBetweenBatches=\"0\"> \r\n        <target name =\"mipLoggertarget\" xsi:type=\"File\" fileName=\"D:/Log/${gdc:item=jobId}/MIP/MipLogger.log\" layout=\"${message}\" keepFileOpen=\"true\" />\r\n         </target> \r\n\r\n   </targets>\r\n\r\n    <rules>\r\n      <logger name=\"mipLogger\" minlevel=\"Info\" writeTo=\"mipLoggertarget\"/>\r\n    \r\n    </rules>\r\n  </nlog>\r\n\r\n  <startup>\r\n    <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\r\n  </startup>\r\n</configuration>\r\n```\r\n\r\n\r\n.You can see above I am using async way also to genearte the logs .I am generating \r\n141Mb file and its taking \r\n503537.2786ms which is very high if I write a simple program to write same  thing in a file with normal file io operations .(i have generated 1 Gb file in less time in what log stash is genearting above .\r\n\r\nPlease give me the fed back where I am doing wrong .And I am not sure async version is working or not ."},"comment":{"url":"https://api.github.com/repos/NLog/NLog/issues/comments/162099985","html_url":"https://github.com/NLog/NLog/issues/1071#issuecomment-162099985","issue_url":"https://api.github.com/repos/NLog/NLog/issues/1071","id":162099985,"user":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T22:29:33Z","updated_at":"2015-12-04T22:29:33Z","body":"Without `CleanupInvalidFileNameChars` in FileTarget, I get it to 5 sec."}}