<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JasonSamuel.com &#187; event log</title>
	<atom:link href="http://www.jasonsamuel.com/tag/event-log/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasonsamuel.com</link>
	<description>Cool stuff I see in the IT world</description>
	<lastBuildDate>Wed, 25 Jan 2012 21:05:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Creating a custom event log under Event Viewer to log server events</title>
		<link>http://www.jasonsamuel.com/2010/01/08/creating-a-custom-event-log-under-event-viewer-to-log-server-events/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-a-custom-event-log-under-event-viewer-to-log-server-events</link>
		<comments>http://www.jasonsamuel.com/2010/01/08/creating-a-custom-event-log-under-event-viewer-to-log-server-events/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 17:41:43 +0000</pubDate>
		<dc:creator>Jason Samuel</dc:creator>
				<category><![CDATA[Windows Server 2003]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[event log]]></category>
		<category><![CDATA[event viewer]]></category>

		<guid isPermaLink="false">http://www.jasonsamuel.com/?p=321</guid>
		<description><![CDATA[By default, most applications write events to the Application Event Log.  This is a great central place to write logs to but sometimes you might have a requirement to log informational events from an application and you don&#8217;t want it filling up your Application Event Log because of the sheer number of informational events you [...]<p><a href="http://www.jasonsamuel.com/2010/01/08/creating-a-custom-event-log-under-event-viewer-to-log-server-events/">Creating a custom event log under Event Viewer to log server events</a> is a post from: <a href="http://www.jasonsamuel.com">JasonSamuel.com</a></p>
]]></description>
			<content:encoded><![CDATA[<p>By default, most applications write events to the Application Event Log.  This is a great central place to write logs to but sometimes you might have a requirement to log informational events from an application and you don&#8217;t want it filling up your Application Event Log because of the sheer number of informational events you might get a short period of time.  The solution is to create a custom event log for your application to hold these events.  You can then set max log size, overwrite rules, filters, etc. on this event log while your Application Event Log remains clean and intact.</p>
<p>The first step is to create the new log.  You have to do this in the registry.  Open up regedit and navigate to:</p>
<p><code>HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog</code></p>
<p>Right click on the Eventlog key and click New &gt; Key</p>
<p>Name this new key the same name you want your new event log to be named.  By default it will create the new .evt file here:</p>
<p><code>C:\WINDOWS\System32\Config\New Key #1.evt</code></p>
<p>You can always rename it by editing the string value data in the registry if you like.</p>
<p>Now you need to add Sources to your new event log.  Right click in the right window pane under your new key and add a new Multi-String value called &#8220;Sources&#8221; and add the name of each of your applications on each line.  It should look something like this:</p>
<p><a href="http://www.jasonsamuel.com/wp-content/uploads/2010/01/11.gif"><img class="alignnone size-medium wp-image-325" title="1" src="http://www.jasonsamuel.com/wp-content/uploads/2010/01/11-300x66.gif" alt="" width="300" height="66" /></a></p>
<p>Now you need to move the association of your application from the Application event log to your new Custom log.  Just expand the &#8220;Application&#8221; key located at:</p>
<p><code>HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application</code></p>
<p>and copy whatever key you see in there for your app under your new Custom log:</p>
<p><code>HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\CustomLog</code></p>
<p>There&#8217;s no copy/paste command so you can recreate the key if it&#8217;s small or you can export/import if it&#8217;s something complicated and you are afraid of mistyping something.  MAKE SURE to delete it from Application after you add it to the Custom log or it will not write events to your new log since Windows thinks its still associated with the Application log.  If it is a custom source, you need to create a DWORD value under this key with the value of 1:</p>
<p><a href="http://www.jasonsamuel.com/wp-content/uploads/2010/01/21.gif"><img class="alignnone size-medium wp-image-326" title="2" src="http://www.jasonsamuel.com/wp-content/uploads/2010/01/21-300x53.gif" alt="" width="300" height="53" /></a></p>
<p>You will also notice my custom app in this example is a .NET 2.0 appliaction so I want .NET to write the events to the log.  I have to create a string value called EventMessageFile and give it the path to the .NET 2.0 event log message dll:</p>
<p><code>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll</code></p>
<p>Now you should reboot your server.  When it&#8217;s back up, check and see if your new event log appears under Event Viewer.  If your application is not writing events to your new log, test it manually by opening a command prompt and going to:</p>
<p><code>C:\WINDOWS\system32</code></p>
<p>and typing:</p>
<p><code>eventcreate /l CustomLog /t Information /so Application1 /id 1 /d &quot;Test message&quot;</code></p>
<p>You should get a message saying it was successfully written or you should get an error message with details on why it was not written.  If you followed the steps in this blog post, it should write the event just fine.</p>
<p><a href="http://www.jasonsamuel.com/2010/01/08/creating-a-custom-event-log-under-event-viewer-to-log-server-events/">Creating a custom event log under Event Viewer to log server events</a> is a post from: <a href="http://www.jasonsamuel.com">JasonSamuel.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasonsamuel.com/2010/01/08/creating-a-custom-event-log-under-event-viewer-to-log-server-events/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.jasonsamuel.com @ 2012-02-09 18:09:17 -->
