With a few changes in the Elmah sourcecode, you can have all your sites writing to the same database. You can then configure one mastersite that displays all of the exceptions with the application that threw it.
Eric King shows how in this blog post http://blog.devadept.com/2010/02/using-elmah-with-multiple-applications.html
To summarize:
Create two additional stored procedures in the database called ELMAH_GetErrorsXML_Master and ELMAH_GetErrorXML_Master without the applicationname parameter.
Then create a SQLMasterErrorLog class based on the existing ‘SQLErrorLog.cs’ class. In this edit the GetErrorXml() and GetErrorsXML() methods to call the new stored procedures
public static SqlCommand GetErrorXml(string appName, Guid id)
{
SqlCommand command = new SqlCommand("ELMAH_GetErrorXml_Master");
command.CommandType = CommandType.StoredProcedure;
SqlParameterCollection parameters = command.Parameters;
parameters.Add("@ErrorId", SqlDbType.UniqueIdentifier).Value = id;
return command;
}
public static SqlCommand GetErrorsXml(string appName, int pageIndex, int pageSize)
{
SqlCommand command = new SqlCommand("ELMAH_GetErrorsXml_Master");
command.CommandType = CommandType.StoredProcedure;
SqlParameterCollection parameters = command.Parameters;
parameters.Add("@PageIndex", SqlDbType.Int).Value = pageIndex;
parameters.Add("@PageSize", SqlDbType.Int).Value = pageSize;
parameters.Add("@TotalCount", SqlDbType.Int).Direction = ParameterDirection.Output;
return command;
}
Change the RendorErrors() method in the ErrorLogPage class to display an extra column in the log viewer table for the Application Name.
Add the following to the table header
headRow.Cells.Add(FormatCell(new TableHeaderCell(), "Host", "host-col"));
headRow.Cells.Add(FormatCell(new TableHeaderCell(), "App", "app-col"));
And the following in the for loop creating the childrows
bodyRow.Cells.Add(FormatCell(new TableCell(), error.HostName, "host-col"));
bodyRow.Cells.Add(FormatCell(new TableCell(), error.ApplicationName, "app-col"));
Now all you need is a single empty website that has elmah configured. Instead of the normal SqlErrorLog use the following
<errorLog type="Elmah.SqlMasterErrorLog, Elmah" connectionStringName="elmah"/>