Browse files

Additional logging

  • Loading branch information...
1 parent 537239f commit 0e88092ce3ae66172b2da0f6ea27ece0b3c50cc3 @dlidstrom committed Mar 8, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 Words.Web/Controllers/HomeController.cs
View
5 Words.Web/Controllers/HomeController.cs
@@ -1,13 +1,17 @@
namespace Words.Web.Controllers
{
using System.Diagnostics;
+ using System.Globalization;
using System.Linq;
using System.Web.Mvc;
+ using NLog;
using Words.Web.Models;
using Words.Web.ViewModels;
public class HomeController : Controller
{
+ private static readonly Logger log = LogManager.GetCurrentClassLogger();
+
/// <summary>
/// See http://forums.asp.net/t/1671805.aspx/1.
/// </summary>
@@ -31,6 +35,7 @@ public ActionResult Index(string q)
millis = 1000.0 * sw.ElapsedTicks / Stopwatch.Frequency;
nodes = MvcApplication.WordFinder.Nodes;
results = new ResultsViewModel(matches, millis);
+ log.Info(CultureInfo.InvariantCulture, "Query '{0}',{1},{2:F2}", q, nodes, millis);
}
// save query

0 comments on commit 0e88092

Please sign in to comment.