Elmah: to find more, query AllXml as Xml!


select convert(xml,AllXml)
.value('(//queryString/item[@name="id"]/value/@string)[1]','nvarchar(255)') as product_id
, errorid
from elmah_error
where convert(xml,AllXml)
.exist('//item[@name="PATH_INFO"]/value[@string="/products/product.aspx"]') = 1


Since Elmah stores in the AllXml column many informations for the logged errors, those can be queried in the XPath/XQuery fashion. The AllXml values needs to be converted to the Xml type and the great thing is MS-SQL Server supports XML queries.

This sample outputs all values used for the "id" query string field, at the "/products/products.aspx" requests. In this way will get a good idea what to fix on that page.

Comments

Popular posts from this blog

IIS 7.5, HTTPS Bindings and ERR_CONNECTION_RESET

Table Per Hierarchy Inheritance with Column Discriminator and Associations used in Derived Entity Types

The <link> saga on ASP .Net