Wednesday, August 10, 2011

Where are my IIS Logs?


Although you may have bucket loads of logging taking place in your web applications/sites, you may still feel the need to make use of the IIS 6.0 logs. Use the following steps to track down these hidden away log files:

  1. Open Internet Information Services (IIS 6.0)
  2. Right-click the desired web site and select properties
  3. On the Web Site tab, at the bottom is the Active Log Format; select the properties button next to it
  4. You'll now have a box that contains the log file directory and the log file name. Together they make the full log path.
In IIS 7.0
Click the desired web site
On the right side in the "IIS" section there will be a logging icon. click it
you will find the log related information as below


In this window you can also change useful settings like what request/response details are recorded in the logs. Some useful options not selected by dfault are bytes sent, bytes received and referrer (useful for tracking 404s in certain cases).

How to format Currency (Pound/Dollar/Euro etc) using C#/VB.NET/Csharp

Formatting Currency in C#/VB.NET/Csharp Writeline function

You can use .NET's Composite Formatting to format the currency as shown below

Double Incentive = 234.45;
Console.WriteLine("The agreed incentive in local currency is {0:C} ", Incentive);


If you want to convert it into dollars/pounds etc you need to change the culture info :

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false);
Console.WriteLine("The agreed incentive in USD is {0:C} ", Incentive);


Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB", false);
Console.WriteLine("The agreed incentive in GBP is {0:C} ", Incentive);


The above code needs the following directives

  1. using System.Threading;
  2. using System.Globalization;