<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Error-Logging Class, input please.</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Error-Logging Class, input please.</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Sun, 26 May 2013 01:54:11 GMT</pubDate>
	<lastBuildDate>Sun, 26 May 2013 01:54:11 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>7</c9:totalResults>
	<c9:pageCount>-7</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p>Well, I'm about to start developing an admin section to an internal-web-app we use in our office and I want to add a logging class to it to track wo does what, when, and what the result was...etc.<br /><br /><i>user Michael Smith attempted to access Customer Records for Smith, John at 12:45pm on Wednesday, November 28, 2007. Failed.<br /><br />user Jonathan Sampson accessed Customer Records for Smith, John at 12:53pm on Wednesday, November 28, 2007. Success.<br /><br />user Jonathan Sampson deactivated Customer Account for Smith, John at 1:28pm on Wednesday, November 28, 2007. Success.</i><br /><br />That sort of thing, of course the values would be pulled from the database.<br /><br />So I'm curious to hear how you guys have designed your classes in the past. Do you have enumerated lists within your class to manage your event-types (&quot;Accessed an account&quot;, &quot;Removed an account&quot;, &quot;Created an account&quot;)<br /><br />I've never really designed a class like this before, so I'm coming from a completely blank-slate...which I guess is cool <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />Jonathan<br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/259292#259292</link>
		<pubDate>Wed, 28 Nov 2007 16:13:03 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/259292#259292</guid>
		<dc:creator>jsampsonPC</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/jsampsonPC/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p>That's exactly when <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">
aspect-oriented programming</a> would come in handy.<br /><br />I did such a logger once upon a time. I was lucky since I had one single method that I passed in the stuff that had to be saved and another method that I passed in the stuff that had to be loaded.<br /><br />What I did was outputting something like:<br /><br />User&nbsp;INSERT &lt;TABLE&gt; &lt;paramslist&gt; SUCCESS<br /><br />where I used to parse the SQL statement and success of that method to return me that string.<br /><br />You could probably go with an enum that is converted to a string (by a method that perhaps does a lookup in a resources file) to determine your action...<br /><br />You could perhaps even go further and store the data that you require for your logging in a database and define some rules (dunno if you could do that directly in the database - depents on your scenario) that are then looked up in the database and applied...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/698906978f45434eaf0c9dfa0090a28f#698906978f45434eaf0c9dfa0090a28f</link>
		<pubDate>Wed, 28 Nov 2007 17:24:42 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/698906978f45434eaf0c9dfa0090a28f#698906978f45434eaf0c9dfa0090a28f</guid>
		<dc:creator>Christian Liensberger</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/littleguru/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p>you have to provide more information about how you implemented the business logics of your web-application.<br /><br />You can create a user class, and in that user class, define options in the form of a switch statement.
<br /><br />switch (UserRequest)<br />{<br />&nbsp;&nbsp;&nbsp; case &quot;A&quot;:<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Console.WriteLine (&quot;user {0} has done {1} at {2}&quot;, userClass.UserName, userClass.Accessed, DateTime.Now.ToString());<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; //etc... <br />&nbsp;&nbsp;&nbsp; default:<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; break;<br />}<br /><br /><br />it depends on your implementation.<br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/27d4ec66a87e47b481599dfa0090a2e2#27d4ec66a87e47b481599dfa0090a2e2</link>
		<pubDate>Wed, 28 Nov 2007 17:58:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/27d4ec66a87e47b481599dfa0090a2e2#27d4ec66a87e47b481599dfa0090a2e2</guid>
		<dc:creator>SecretSoftware</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SecretSoftware/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p><blockquote>
<div class="quoteAuthor">jsampsonPC wrote:</div>
<div class="quoteBody">&#65279;Well, I'm about to start developing an admin section to an internal-web-app we use in our office and I want to add a logging class to it to track wo does what, when, and what the result was...etc.<br /><br /><i>user Michael Smith attempted to access Customer Records for Smith, John at 12:45pm on Wednesday, November 28, 2007. Failed.<br /><br />user Jonathan Sampson accessed Customer Records for Smith, John at 12:53pm on Wednesday, November 28, 2007. Success.<br /><br />user Jonathan Sampson deactivated Customer Account for Smith, John at 1:28pm on Wednesday, November 28, 2007. Success.</i><br /><br />That sort of thing, of course the values would be pulled from the database.<br /><br />So I'm curious to hear how you guys have designed your classes in the past. Do you have enumerated lists within your class to manage your event-types (&quot;Accessed an account&quot;, &quot;Removed an account&quot;, &quot;Created an account&quot;)<br /><br />I've never really designed a class like this before, so I'm coming from a completely blank-slate...which I guess is cool <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />Jonathan<br /></div>
</blockquote>
<br /><br />well you can do several kinds of logging and if you need a really good traking then IMHO you should impliment multiple logs.<br /><br />for example if you use the asp.net membership system you can log asp.net events to the event log and to a database table.<br /><br />this can for example log login errors and application exceptions...<br />more later on sql logging.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/3a755a7db3364cd8a3bb9dfa0090a333#3a755a7db3364cd8a3bb9dfa0090a333</link>
		<pubDate>Wed, 28 Nov 2007 18:14:55 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/3a755a7db3364cd8a3bb9dfa0090a333#3a755a7db3364cd8a3bb9dfa0090a333</guid>
		<dc:creator>figuerres</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/figuerres/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p>Ok back from Lunch <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />SQL and data; depending on what you need for the system sql triggers that log updates and deletes may be a good thing.<br /><br />there are several ways to do this but they all center around the idea that a trigger will fire inthe sql server when the table is updated.<br /><br />even if for example the user gets a sql connection via some other app that does not use your business logic, say they use MS access and mess with the data....<br /><br />they will not know that the triggers will store the edits....<br /><br />you can log the date and time of the edits and &quot;undo&quot; the chnages and possibly also log what sql user login was used to find the guilty parties.<br /><br />by hand this audit trail can be a bee to create, google around and you will find many ways folks have done them.<br /><br />one I read of but have not yet used is a SQL CLR based package.<br /><br /><br />with SQL CLR you could create one set of C# routines to do the work and one table to hold the log.<br /><br />then you could add and remove logging on any table with minimal work.<br /><br />example of log table:<br />ID<br />DateTime<br />TableRowID<br />TableName<br />ColumnName<br />OldValue<br />LoginUserID<br /><br />so you take a table and select all the rows with that table name ordered by datetime desc and you can re-create any edits. or prior version of the data.<br />trade offs.. ok this writes a bunch of rows but only saves the columns you want to track, and works even if you alter the table at some point (well works as good as it can)<br /><br />some folks create a dupe table and just dunmp the whole row....<br />but then you have 2 x the tables as your database and a different trigger for every table.<br /><br /><br /><br /><br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/6f24ccb2915b40d9a7fd9dfa0090a38f#6f24ccb2915b40d9a7fd9dfa0090a38f</link>
		<pubDate>Wed, 28 Nov 2007 19:33:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/6f24ccb2915b40d9a7fd9dfa0090a38f#6f24ccb2915b40d9a7fd9dfa0090a38f</guid>
		<dc:creator>figuerres</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/figuerres/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p>about asp.net logging, look at this snipet:</p>
<p>&lt;healthMonitoring&gt;<br />&nbsp;&lt;!--&nbsp; Event Log Provider being added. --&gt;<br />&nbsp;&lt;providers&gt;<br />&nbsp;&nbsp;&nbsp; &lt;add name=&quot;EventLogProvider&quot; type=&quot;System.Web.Management.EventLogWebEventProvider,System.Web,...&quot; /&gt;<br />&nbsp;&lt;/providers&gt;<br />&nbsp;&lt;!--&nbsp; Event mapping provides a friendly name to the events based on the WebBaseErrorEvent class.&nbsp; --&gt;<br />&nbsp;&lt;eventMappings&gt;<br />&nbsp;&nbsp;&nbsp; &lt;add name=&quot;All Errors&quot; type=&quot;System.Web.Management.WebBaseErrorEvent,System.Web,..&quot; startEventCode=&quot;0&quot; endEventCode=&quot;2147483647&quot; /&gt;<br />&nbsp;&lt;/eventMappings&gt;<br />&nbsp;&lt;!-- Rule tying the &quot;All Errors&quot; event mapping to the EventLog Provider.&nbsp; --&gt;<br />&nbsp;&lt;rules&gt;<br />&nbsp;&nbsp;&nbsp; &lt;add name=&quot;All Errors Default&quot; eventName=&quot;All Errors&quot; provider=&quot;EventLogProvider&quot; profile=&quot;Default&quot; minInstances=&quot;1&quot; maxLimit=&quot;Infinite&quot; minInterval=&quot;00:01:00&quot; custom=&quot;&quot; /&gt;<br />&nbsp;&lt;/rules&gt;<br />&lt;/healthMonitoring&gt;<br /><br />this goes in the web.config <br />it will log asp.net events to the event log, you can also use the same setup to send data to sql server or other targets.<br /><br />and I think you can raise custom events in your web code that get logged the same way.<br />so you could raise a &quot;user opened form&quot; event and a &quot;user added foo&quot; event and so forth...</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/caf7abc6e0484c4fa1f29dfa0090a3f0#caf7abc6e0484c4fa1f29dfa0090a3f0</link>
		<pubDate>Wed, 28 Nov 2007 19:41:36 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/caf7abc6e0484c4fa1f29dfa0090a3f0#caf7abc6e0484c4fa1f29dfa0090a3f0</guid>
		<dc:creator>figuerres</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/figuerres/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Error-Logging Class, input please.</title>
		<description><![CDATA[<p>Yea use something out of a package as your base<br /><br />OR:<br />&nbsp;<br />Make a lookup table for error codes in standard form like:<br /><br />Event[0001]: &lt;bLandon&gt;&nbsp;Loggged in.<br /><br />Then have a lookup table:<br />Code&nbsp;&nbsp; Desc&nbsp;&nbsp;&nbsp; Type<br />0001 - Log in - N<br /><br />Then a Action Table:<br /><br />ID Desc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Command<br />N No Action NULL<br /><br /><br />Then you can have a command interpreter that does nothing on NULL and does other things when something else is passed in Like:<br />EMAIL &lt;<a href="mailto:admin@mysite.com">admin@mysite.com</a>&gt; ALL CONTENTS<br /><br />You could even get as fancy as making powershell commandlets and make the command field contain power shell code. See last months MSDN magazine for more on building custom comandlets.<br /><br />You could then have shell session going that has as limited a command set as you want.<br /><br /><br />That way its a database change to change actionable items to other actions or do nothing events or errors.<br /><br />Hope this gives you some ideas.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/ea9a387b9deb42c498c19dfa0090a44c#ea9a387b9deb42c498c19dfa0090a44c</link>
		<pubDate>Thu, 29 Nov 2007 00:12:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259292-Error-Logging-Class-input-please/ea9a387b9deb42c498c19dfa0090a44c#ea9a387b9deb42c498c19dfa0090a44c</guid>
		<dc:creator>odujosh</dc:creator>
		<slash:comments>7</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/odujosh/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>