I currently work for a company that has many custom applications created internally. There are currently no standards for many things. I would like to implement a way to record / track errors that occur in these programs (most of them are asp.net).
I am currently thinking of handling this in Global.asax in an application error method. First try to save the information in the error / tracking log database, and if that fails, try sending an email.
What type of information is most useful for receiving error messages and other application variables (page, username, etc.).
I am currently thinking of using two tables, one for general information about errors and applications, and the second for information about exceptions. It will be a one-to-many relationship to pass internal Exceptions that may come from one application-level exception.
I’m sure that I don’t have enough details and would like to hear your strategy for solving this problem.
Jeff Atwood wrote a great exception handler that you should look at CodeProject
I tried to collect as much information as possible. Stack Information Session Information Error Location
I would also install a web service that applications access to store exception information on your system.
, ELMAH , .
(, Log4Net), , , , .., . post , .
ASP.NET.
EDIT: , ELMAH, ASP.NET "" .
, , - .
, , , , , !
, , bugs@mydomain.com
: [ ] [ : ddmmyyyy hhmmss] : , , , , Referrer.
ASP.NET , , , .
, , , , ( ), XML [errorLog_ mmm_yyyy.xml], "" gridview, XML , .
try { // production code } catch(Exception ex) { Utilities.Mail.SendError(ex); }
: Application_Error global.asax:
<%@ Application Language="C#" %> <%@ Import Namespace="System.Diagnostics" %> <script language="C#" runat="server"> void Application_Error(object sender, EventArgs e) { //get reference to the source of the exception chain Exception ex = Server.GetLastError().GetBaseException(); //log the details of the exception and page state to the //Windows Event Log EventLog.WriteEntry("myWebApplication name", "MESSAGE: " + ex.Message + "\nSOURCE: " + ex.Source + "\nFORM: " + Request.Form.ToString() + "\nQUERYSTRING: " + Request.QueryString.ToString() + "\nTARGETSITE: " + ex.TargetSite + "\nSTACKTRACE: " + ex.StackTrace, EventLogEntryType.Error); Utilities.Mail.SendError(ex); } </script>
, XML SendError (Exception).
, https. , ( ). , .
, , , , , ( ASPNET), , , /, ..
, - , (, ). .
, HTTPS, , , , . , , .
, .
-, , , , , db .., , .
, , , , .
(, , , ), , .
, , , . .
Log.txt. , -, .
- , . .
, , (ID, , ), , ( , , ) , ( , , ). SQL. ( ..). DisplayMessage InternalMessage. DisplayMessage . InternalMessage .
Page_Error Application_Error.
key-value web.config, ( ). vaue, . , . , , . web.config.
: CALM
-, , Clearwind Consulting. , . , , , , , , , 30 . Clearwind -. , , -.
, . RSS, , , . , iPhone, . Django, JSON, RoR, XML, CSV .., . .
, www.areciboapp.com.
, ( ) - , , 404. . , . , .
It is a very good idea to log in to a custom event log on the server, as well as for any other logging and notification. If an error occurs due to a problem with the infrastructure, the same problem can also cause the error handler to send e-mail or save it to the database.
Source: https://habr.com/ru/post/1698709/More articles:What online collaboration sites do you know? - project-managementRows in their own columns depending on their value - sqlXML compression - c #How can I submit a form to RoR whenever the input text field changes? - javascriptHow to concatenate web pages in ASP.NET - asp.netDisplay controller view from OpenGL view - iphoneДоступ к адресной книге без выбора или пользовательского интерфейса - iphoneHow to make Internet Explorer open Invisible in VB6? - internet-explorerWhat knowledge is needed to create a patch for your game or application? - assemblyWhat is the best way to visualize a “resolution matrix” in a UML class diagram? - oopAll Articles