<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Alik Levin's : Auditing and Logging</title><link>http://blogs.msdn.com/alikl/archive/tags/Auditing+and+Logging/default.aspx</link><description>Tags: Auditing and Logging</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Examining WCF Diagnostic Traces Using Service Trace Viewer Tool (SvcTraceViewer.exe)</title><link>http://blogs.msdn.com/alikl/archive/2007/10/23/examining-wcf-diagnostic-traces-using-service-trace-viewer-tool-svctraceviewer-exe.aspx</link><pubDate>Tue, 23 Oct 2007 16:52:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5624225</guid><dc:creator>alikl</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/alikl/comments/5624225.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=5624225</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=5624225</wfw:comment><description>&lt;p&gt;Service Trace Viewer Tool (SvcTraceViewer.exe) tool comes with &lt;a href=" http://www.microsoft.com/downloads/details.aspx?familyid=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;amp;displaylang=en" target="_blank"&gt;Microsoft® Windows® Software Development Kit for Windows Vista™ and .NET Framework 3.0 Runtime Components&lt;/a&gt;. It allows to view WCF diagnostics traces in very convenient way. "&lt;a href="http://msdn2.microsoft.com/en-us/library/aa751795.aspx" target="_blank"&gt;Using Service Trace Viewer for Viewing Correlated Traces and Troubleshooting&lt;/a&gt;" article explains how.&lt;/p&gt; &lt;p&gt;Specifically I used it for two scenarios&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Troubleshooting&lt;/strong&gt; when implementing &lt;a href="http://msdn2.microsoft.com/en-us/library/ms735117.aspx" target="_blank"&gt;Message Security with a Windows Client without Credential Negotiation&lt;/a&gt;. Using SvcTraceViewer.exe I spotted the following error message: &lt;em&gt;"&lt;font color="#d90000"&gt;The security timestamp is invalid because its creation time ('9/19/2007 5:43:39 PM') is in the future. Current time is '9/19/2007 8:43:42 AM' and allowed clock skew is '00:05:00'."&lt;/font&gt;&lt;/em&gt;&lt;font color="#d90000"&gt; &lt;/font&gt;I immediately understood that machines clocks are out of sync - which is super important for Kerberos to work properly.  &lt;li&gt;&lt;strong&gt;Examining message sizes&lt;/strong&gt; with different protection mechanisms and &lt;a href="http://msdn2.microsoft.com/en-us/library/Aa347692.aspx" target="_blank"&gt;levels&lt;/a&gt;. I needed to understand the impact of data protection mechanisms on general performance. See &lt;a href="http://msdn2.microsoft.com/en-us/library/ms733137.aspx" target="_blank"&gt;How Message and Transport Security compare&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Related posts&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/alikl/archive/2007/07/26/wcf-security-in-intranet-scenario-thoughts-on-cons-and-pros.aspx"&gt;WCF Security In Intranet Scenario : Thoughts On Cons and Pros&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5624225" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Deployment+Phase/default.aspx">Deployment Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Auditing+and+Logging/default.aspx">Auditing and Logging</category></item><item><title>Use Sysinternals DebugView To Diagnose The Application</title><link>http://blogs.msdn.com/alikl/archive/2007/07/16/use-sysinternals-debugview-to-diagnose-the-application.aspx</link><pubDate>Mon, 16 Jul 2007 18:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3898886</guid><dc:creator>alikl</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/alikl/comments/3898886.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=3898886</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=3898886</wfw:comment><description>&lt;P&gt;"Unspecified error", "Catastrophic failure", "Object reference not set to an instance of an object" and other "self explanatory" errors promise no easy debugging. &lt;A href="http://msdn2.microsoft.com/en-us/library/ms998325.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms998325.aspx"&gt;Good instrumentation of the application&lt;/A&gt;&amp;nbsp; to the rescue! The techniques described&amp;nbsp;in the paper explores on very &lt;A href="http://blogs.msdn.com/alikl/archive/2007/05/02/asp-net-health-monitoring-means-logging-and-auditing.aspx" mce_href="http://blogs.msdn.com/alikl/archive/2007/05/02/asp-net-health-monitoring-means-logging-and-auditing.aspx"&gt;often overlooked healthmonitoring&lt;/A&gt; feature of ASP.NET 2.0. It supports few providers - mechanisms that collect and log the events emitted by the application:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;SimpleMailWebEventProvider.&lt;/B&gt; This provider sends e-mail for event notifications. 
&lt;LI&gt;&lt;B&gt;TemplatedMailWebEventProvider.&lt;/B&gt; This provider uses templates to define and format e-mail messages sent for event notifications. 
&lt;LI&gt;&lt;B&gt;SqlWebEventProvider. &lt;/B&gt;This provider logs event details to a SQL Server database. If you use this provider, you should encrypt the connection string in your Web.config file by using the Aspnet_regiis.exe tool. 
&lt;LI&gt;&lt;B&gt;EventLogWebEventProvider.&lt;/B&gt; This provider logs events to the Windows application event log. 
&lt;LI&gt;&lt;B&gt;TraceWebEventProvider.&lt;/B&gt; This provider logs events as ASP.NET trace messages. 
&lt;LI&gt;&lt;B&gt;WmiWebEventProvider.&lt;/B&gt; This provider maps ASP.NET health monitoring events to Windows Management Instrumentation (WMI) events.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Nothing is to&amp;nbsp;log into file or to show interactively though.&lt;/P&gt;
&lt;P&gt;Here is another way for &lt;STRONG&gt;&lt;EM&gt;quick and dirty&lt;/EM&gt;&lt;/STRONG&gt; understanding what happened in the app (assuming instrumentation is in place). Instrumentation mechanism is my old friend &lt;EM&gt;System.Diagnostics.Debug.WriteLine(string message)&lt;/EM&gt;. This command emits messages to &lt;A href="http://msdn2.microsoft.com/en-us/library/4y5y10s7.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/4y5y10s7.aspx"&gt;OutputDebugString&lt;/A&gt;. The best tool that collects and shows the messages that&amp;nbsp;I found so far is &lt;A href="http://www.microsoft.com/technet/sysinternals/default.mspx" target=_blank mce_href="http://www.microsoft.com/technet/sysinternals/default.mspx"&gt;Sysinternal's&lt;/A&gt; &lt;A href="http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx" target=_blank mce_href="http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx"&gt;Debugview&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The following code:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trace.WriteLine("Loading the page"); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;/EM&gt;
&lt;P&gt;Would interactively look like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/UseSysinternalsDebugviewToDiagnoseTheApp_82/image.png" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/UseSysinternalsDebugviewToDiagnoseTheApp_82/image.png"&gt;&lt;IMG height=130 alt=image src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/UseSysinternalsDebugviewToDiagnoseTheApp_82/image_thumb.png" width=409 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/UseSysinternalsDebugviewToDiagnoseTheApp_82/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;DebugView also offers logging the events into file - very handy.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While healthmonitoring is great to log stuff for later analyzing, tracing with&amp;nbsp;DebugView is great for interactive debugging. I can think of some wrapper class that is used by the application to log the messages, and the implementation uses both &lt;A href="http://msdn2.microsoft.com/en-us/library/ms998306.aspx#paght000011_step1" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms998306.aspx#paght000011_step1"&gt;healthmonitoring custom events&lt;/A&gt; and Debug.WriteLine. Both then rely on the web.config stuff.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy and happy debugging, tracing, instrumentation, and other veggies.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3898886" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Practices/default.aspx">Practices</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Auditing+and+Logging/default.aspx">Auditing and Logging</category></item><item><title>ASP.NET Health Monitoring Means Logging And Auditing</title><link>http://blogs.msdn.com/alikl/archive/2007/05/02/asp-net-health-monitoring-means-logging-and-auditing.aspx</link><pubDate>Wed, 02 May 2007 21:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2378459</guid><dc:creator>alikl</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2378459.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2378459</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2378459</wfw:comment><description>&lt;P&gt;I&amp;nbsp;constantly keep seeing&amp;nbsp;ASP.NET developers using &lt;A href="http://logging.apache.org/log4net/" target=_blank mce_href="http://logging.apache.org/log4net/"&gt;log4net&lt;/A&gt;&amp;nbsp;for logging and auditing their Web apps. While I have nothing against &lt;A href="http://logging.apache.org/log4net/" target=_blank mce_href="http://logging.apache.org/log4net/"&gt;log4net&lt;/A&gt;&amp;nbsp;- it is great stuff I presume though never used it - it is pretty funny to me to get why people do not use built-in &lt;A href="http://quickstart.developerfusion.co.uk/QuickStart/aspnet/doc/monitoring/webevents.aspx" target=_blank mce_href="http://quickstart.developerfusion.co.uk/QuickStart/aspnet/doc/monitoring/webevents.aspx"&gt;ASP.NET 2.0 Health Monitoring&lt;/A&gt;. I started to ask - turns out people are just not aware of it... &lt;/P&gt;
&lt;P&gt;Our logging story with ASP.NET 1.1 was pretty bad although with small effort one could do very cool things with TraceListener.&lt;/P&gt;
&lt;P&gt;I think it was mistake calling it Health Monitoring since folks miss it - no one looks for Health Monitoring but logging or may be auditing.&lt;/P&gt;
&lt;P&gt;So here is&amp;nbsp;detailed how-to for ASP.NET 2.0 Auditing and Logging, ...ehm ...Health Monitoring:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/ms998306.aspx" target=_blank mce_href="http://msdn2.microsoft.com/ms998306.aspx"&gt;How To: Use Health Monitoring in ASP.NET 2.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/ms998325.aspx" target=_blank mce_href="http://msdn2.microsoft.com/ms998325.aspx"&gt;How To: Instrument ASP.NET 2.0 Applications for Security&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For those who still on ASP.NET 1.1 similar pluggable design can be achieved by implementing Custom TraceListener. Then registering it with web.config. In order to send error message to it one uses standard System.Diagnostics.Trace.WriteLine(message);&lt;/P&gt;
&lt;P&gt;Here is custom TraceListener:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;namespace&lt;/SPAN&gt; DeepDive2004&lt;BR&gt;{&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;class&lt;/SPAN&gt; CustomListener : TextWriterTraceListener&lt;BR&gt;{&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/SPAN&gt; CustomListener() : &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/SPAN&gt;()&lt;BR&gt;{&lt;BR&gt;} &lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/SPAN&gt; CustomListener(&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/SPAN&gt; initData)&lt;BR&gt;{ &lt;BR&gt;&lt;BR&gt;} &lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/SPAN&gt; Write(&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/SPAN&gt; message)&lt;BR&gt;{&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//ACTUAL CODE TO SEND MESSAGES TO SOME STORE, SAY WEB SERVICE&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/SPAN&gt;.Write (message);&lt;BR&gt;}&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;override&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/SPAN&gt; WriteLine(&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/SPAN&gt; message)&lt;BR&gt;{&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//ACTUAL CODE TO SEND MESSAGES TO SOME STORE, , SAY WEB SERVICE&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;base&lt;/SPAN&gt;.WriteLine (message);&lt;BR&gt;} &lt;BR&gt;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/SPAN&gt;and here is web.config configuration:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;system.diagnostics&amp;gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: maroon; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;trace&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;autoflush&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;="true"&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;indentsize&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;="0"&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: maroon; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;listeners&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: maroon; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;add&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;="MyCustomListener"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;type&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;="DeepDive2004.CustomListener, DeepDive2004"&lt;/SPAN&gt; &lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;initializeData&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;="http://MyWebService"&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: maroon; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;listeners&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: maroon; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;trace&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&amp;lt;/system.diagnostics&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Those who is interested in using &lt;A href="http://logging.apache.org/log4net/" target=_blank mce_href="http://logging.apache.org/log4net/"&gt;log4net&lt;/A&gt;&amp;nbsp;I suggest reading Mitch's excellent post&amp;nbsp;&lt;A href="http://mitch-wheat.blogspot.com/2007/04/log4net-net-logging-tool.html" target=_blank mce_href="http://mitch-wheat.blogspot.com/2007/04/log4net-net-logging-tool.html"&gt;log4net: .NET Logging Tool&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Ed. - After posting this one I've jsut noticed your personal approach to my question here &lt;A class="" href="http://mitch-wheat.blogspot.com/2007/05/logging-and-aspnet-health-monitoring.html" target=_blank mce_href="http://mitch-wheat.blogspot.com/2007/05/logging-and-aspnet-health-monitoring.html"&gt;Logging and ASP.NET Health Monitoring&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Mitch, you rock, man!&lt;/P&gt;
&lt;P&gt;Enjoy&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2378459" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Auditing+and+Logging/default.aspx">Auditing and Logging</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Planning+Phase/default.aspx">Planning Phase</category></item><item><title>File Access Auditing - I Am Not Afraid Of GPO</title><link>http://blogs.msdn.com/alikl/archive/2007/04/01/file-access-auditing-i-am-not-afraid-of-gpo.aspx</link><pubDate>Mon, 02 Apr 2007 00:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2007822</guid><dc:creator>alikl</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/alikl/comments/2007822.aspx</comments><wfw:commentRss>http://blogs.msdn.com/alikl/commentrss.aspx?PostID=2007822</wfw:commentRss><wfw:comment>http://blogs.msdn.com/alikl/rsscomments.aspx?PostID=2007822</wfw:comment><description>&lt;P&gt;Security logging and auditing mitigates repudiation threat (the "R" in STRIDE, see also &lt;A class="" href="http://www.securityguidanceshare.com/wiki/Threats#Auditing_and_Logging" target=_blank mce_href="http://www.securityguidanceshare.com/wiki/Threats#Auditing_and_Logging"&gt;Auditing and Logging&lt;/A&gt;&amp;nbsp;threats). The lesser coding the better security. Here is the no coding auditing for file access using Group Policy&lt;/P&gt;
&lt;P&gt;From &lt;A title=http://support.microsoft.com/kb/324739 href="http://support.microsoft.com/kb/324739" target=_blank mce_href="http://support.microsoft.com/kb/324739"&gt;http://support.microsoft.com/kb/324739&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5&gt;&lt;A&gt;&lt;/A&gt;&lt;STRONG&gt;Create a Group Policy Object&lt;/STRONG&gt;&lt;/H5&gt;To create a Group Policy object (GPO) that you can use to turn on auditing in a domain, follow these steps: 
&lt;P&gt;1. Click &lt;B&gt;Start&lt;/B&gt;, point to &lt;B&gt;Administrative Tools&lt;/B&gt;, and then click &lt;STRONG&gt;Active Directory Users and Computers&lt;/STRONG&gt;. 
&lt;P&gt;2. Right-click your domain, and then click &lt;B&gt;Properties&lt;/B&gt;. 
&lt;P&gt;3. Click the &lt;B&gt;Group Policy&lt;/B&gt; tab, and then click &lt;B&gt;New&lt;/B&gt;. 
&lt;P&gt;4. Type the name that you want to use for this policy (for example, Enable auditing policy), and then press ENTER.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B11%5D.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B11%5D.png" atomicselection="true"&gt;&lt;IMG height=223 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B7%5D.png" width=245 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B7%5D.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;5. Click &lt;B&gt;Properties&lt;/B&gt;, and then click the &lt;B&gt;Security&lt;/B&gt; tab. 
&lt;P&gt;6. Click to clear the &lt;B&gt;Allow&lt;/B&gt; check box next to &lt;B&gt;Apply Group Policy&lt;/B&gt; for the security groups that you want to prevent from having this policy applied. 
&lt;P&gt;7. Click to select the &lt;B&gt;Allow&lt;/B&gt; check box next to &lt;B&gt;Apply Group Policy&lt;/B&gt; for the groups to which you want to apply this policy, and then click &lt;B&gt;OK&lt;/B&gt;. 
&lt;P&gt;8. Click &lt;B&gt;OK&lt;/B&gt;, click &lt;B&gt;OK&lt;/B&gt; again, and then quit Active Directory Users and Computers. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B15%5D.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B15%5D.png" atomicselection="true"&gt;&lt;IMG height=284 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B9%5D.png" width=304 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B9%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;A&gt;&lt;/A&gt;&lt;STRONG&gt;Turn On Auditing on a Domain Controller&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1. Click &lt;B&gt;Start&lt;/B&gt;, point to &lt;B&gt;Administrative Tools&lt;/B&gt;, and then click &lt;STRONG&gt;Active Directory Users and Computers&lt;/STRONG&gt;. 
&lt;P&gt;2. Right-click your domain, and then click &lt;B&gt;Properties&lt;/B&gt;. 
&lt;P&gt;3. Click the &lt;B&gt;Group Policy&lt;/B&gt; tab, click the Group Policy object that you want to use, and then click &lt;B&gt;Edit&lt;/B&gt;. 
&lt;P&gt;4. Under &lt;B&gt;Computer Configuration&lt;/B&gt;, expand &lt;B&gt;Windows Settings&lt;/B&gt;, expand &lt;B&gt;Security Settings&lt;/B&gt;, expand &lt;B&gt;Local Policies&lt;/B&gt;, and then click &lt;B&gt;Audit Policy&lt;/B&gt;. 
&lt;P&gt;5. In the right pane, double-click &lt;STRONG&gt;Audit object access&lt;/STRONG&gt;. 
&lt;P&gt;6. Click to select the &lt;STRONG&gt;Define these policy settings&lt;/STRONG&gt; check box, click to select the &lt;B&gt;Success&lt;/B&gt; check box, click to select the &lt;B&gt;Failure&lt;/B&gt; check box, and then click &lt;B&gt;OK&lt;/B&gt;. 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B19%5D.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B19%5D.png" atomicselection="true"&gt;&lt;IMG height=243 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B11%5D.png" width=482 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B11%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;Define auditing on actual file:&lt;/STRONG&gt; 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B23%5D.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B23%5D.png" atomicselection="true"&gt;&lt;IMG height=219 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B13%5D.png" width=372 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B13%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;Test auditing by accessing the file, say double clicking it, then open Event Viewer. 
&lt;P&gt;Similar entry should be there: 
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B27%5D.png" mce_href="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D%5B27%5D.png" atomicselection="true"&gt;&lt;IMG height=248 src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B15%5D.png" width=405 mce_src="http://blogs.msdn.com/blogfiles/alikl/WindowsLiveWriter/FileAccessAuditingIAmNotAffraidOfGroupPo_14DB0/image%7B0%7D_thumb%5B15%5D.png"&gt;&lt;/A&gt; 
&lt;P&gt;Enjoy&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2007822" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/alikl/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Development+Phase/default.aspx">Development Phase</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Implementation/default.aspx">Implementation</category><category domain="http://blogs.msdn.com/alikl/archive/tags/Auditing+and+Logging/default.aspx">Auditing and Logging</category></item></channel></rss>