How do you centralize ELMAH magazines

In my works, we produce websites such as they go out of fashion (i.e. a lot of sites per year)

I want to install ELMAH on all this as a company practice, and then log everything for viewing by our developers. The process should be very simple, because otherwise its use will not be canceled.

I was thinking of creating a central Google Reader account and connecting all RSS feeds for ELMAH installations to it.

my concern is that Google says they only check once an hour, which means that if you use the in-memory storage for ELMAH, there is a chance that errors will be missed when you restart the application pool.

The email is very good, but if everyone starts receiving ELMAH error messages, they start to ignore them - maybe I can set up an additional JUST exchange mailbox for this to keep things separate?

Your thoughts will be greatly appreciated.

(ps this MAY be perceived as subjective - but I believe that someone probably has an answer among a series of subjective answers, which makes it a valid question)

+4
source share
2 answers

With some changes to the Elmah source code, you can use all your sites in one database. Then you can configure one wizard that displays all exceptions with the application that selected it.

Eric King shows how on this blog http://blog.devadept.com/2010/02/using-elmah-with-multiple-applications.html

Summarizing:

Create two additional stored procedures in a database named ELMAH_GetErrorsXML_Master and ELMAH_GetErrorXML_Master without an application name parameter.

Then create the SQLMasterErrorLog class based on the existing SQLErrorLog.cs class. In this case, 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; } 

Modify the RendorErrors () method in the ErrorLogPage class to display an additional column in the log view table for the application name.

Add the following to the table heading

 headRow.Cells.Add(FormatCell(new TableHeaderCell(), "Host", "host-col")); headRow.Cells.Add(FormatCell(new TableHeaderCell(), "App", "app-col")); 

And the next in the for loop creates childrows

 bodyRow.Cells.Add(FormatCell(new TableCell(), error.HostName, "host-col")); bodyRow.Cells.Add(FormatCell(new TableCell(), error.ApplicationName, "app-col")); 

Now you only need one empty website with elmah setup. Instead of the usual SqlErrorLog use

 <errorLog type="Elmah.SqlMasterErrorLog, Elmah" connectionStringName="elmah"/> 
+7
source

I use the ftp method to pass all the XML error (site a, b, c ...) to collect all the XML site error (log site).

in the Global.asax Application_Start add an ElmahErrorLogCustomize task every 10 minutes to transfer all XML to the journal site, after transferring all XML to the website (a, b, c ...) and delete this journal on the website (a, b, c .. .)

+1
source

Source: https://habr.com/ru/post/1341905/


All Articles