title: Create a customized EventLog logname
body: <p>I am trying to create my customized <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog(v=vs.110).aspx" rel="nofollow">EventLog</a> for my service. I was able to customize my <code>source</code> but not not the <code>logName</code> by using <a href="http://msdn.microsoft.com/en-us/library/2awhba7a(v=vs.110).aspx" rel="nofollow">CreateEventSource</a> method. In my service constructor:</p>
  
  <pre><code>        public Service1()
          {
              InitializeComponent();
              eventLog1 = new System.Diagnostics.EventLog();
              if (!System.Diagnostics.EventLog.SourceExists("MySource"))
              {
                  System.Diagnostics.EventLog.CreateEventSource(
                      "MySource", "MyNewLog");
              }
  
              eventLog1.Source = "MySource";
              eventLog1.Log = "MyNewLog";
          }
  </code></pre>
  
  <p>I was able to customize <code>MySource</code> to whatever I want, but whenever I change <code>MyNewLog</code>, my service crashes because this <code>eventLog1</code> is writing specifically to <code>MyNewLog</code> in the Event Viewer. <a href="http://www.c-sharpcorner.com/UploadFile/d551d3/working-with-eventviewer-using-C-Sharp-for-beginners/" rel="nofollow">This article</a> shows you how to check if a <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog(v=vs.110).aspx" rel="nofollow">EventLog</a> <a href="http://msdn.microsoft.com/en-us/library/9d7bfbtc(v=vs.110).aspx" rel="nofollow">Exists</a> and how to <a href="http://msdn.microsoft.com/en-us/library/k2ch3468(v=vs.110).aspx" rel="nofollow">Delete</a> it. But, how do I CREATE a customized EventLog?</p>