Skip to content

Instantly share code, notes, and snippets.

@kurtschindler
Created July 29, 2011 18:36
Show Gist options
  • Save kurtschindler/1114428 to your computer and use it in GitHub Desktop.
Save kurtschindler/1114428 to your computer and use it in GitHub Desktop.
Glimpse Plugin for NHibernate SQL logging
[Glimpse.Core.Extensibility.GlimpsePluginAttribute()]
public class NHGlimpsePlugin : IGlimpsePlugin
{
public object GetData(HttpContextBase context)
{
var data = new List<object[]> { new[] { "Key", "Value" } };
data.Add(new object[] { "*count*", SqlLogger.Count });
foreach (var sqlString in SqlLogger.All())
{
data.Add(new object[] { "*sql*", sqlString });
}
return data;
}
public void SetupInit() { }
public string Name { get { return "NHibernate"; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment