diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 03a524d..a2998a8 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1115 \ No newline at end of file +1120 \ No newline at end of file diff --git a/Common/UserContext.cs b/Common/UserContext.cs index ba5f80a..680e663 100644 --- a/Common/UserContext.cs +++ b/Common/UserContext.cs @@ -60,11 +60,16 @@ namespace FLocal.Common { ); } + public static Guid GetGuid(this Exception exception) { + return Core.Cache.instance.get(exception, () => Guid.NewGuid()); + } + public static XElement ToXml(this Exception exception) { return new XElement("exception", new XElement("type", exception.GetType().FullName), new XElement("message", exception.Message), - new XElement("trace", exception.StackTrace) + new XElement("trace", exception.StackTrace), + new XElement("guid", exception.GetGuid().ToString()) ); } diff --git a/IISMainHandler/WebContext.cs b/IISMainHandler/WebContext.cs index 658b637..e23c584 100644 --- a/IISMainHandler/WebContext.cs +++ b/IISMainHandler/WebContext.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Web; using FLocal.Core; +using FLocal.Common; using FLocal.Common.dataobjects; using FLocal.Common.actions; using System.Xml.Linq; @@ -152,7 +153,7 @@ namespace FLocal.IISHandler { } public void LogError(Exception e) { - using(StreamWriter writer = new StreamWriter(Common.Config.instance.dataDir + "Logs\\" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + "." + Guid.NewGuid() + ".txt")) { + using(StreamWriter writer = new StreamWriter(Common.Config.instance.dataDir + "Logs\\" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + "." + e.GetGuid().ToString() + ".txt")) { writer.WriteLine("Requested url: " + this.httprequest.RawUrl); writer.WriteLine("Remote ip: " + this.httprequest.UserHostAddress); if(this.httprequest.Cookies["session"] != null) { @@ -160,6 +161,7 @@ namespace FLocal.IISHandler { } writer.WriteLine(); writer.WriteLine("Exception: " + e.GetType().FullName); + writer.WriteLine("Guid: " + e.GetGuid().ToString()); writer.WriteLine(e.Message); if(e is FLocalException) { writer.WriteLine(((FLocalException)e).FullStackTrace); diff --git a/templates/Full/Exception.xslt b/templates/Full/Exception.xslt index 8516af9..1009f91 100644 --- a/templates/Full/Exception.xslt +++ b/templates/Full/Exception.xslt @@ -20,12 +20,9 @@ Сообщение об ошибке:
+ ID ошибки: +
- -
-										
-									
-
diff --git a/templates/Lite/Exception.xslt b/templates/Lite/Exception.xslt index 8516af9..1009f91 100644 --- a/templates/Lite/Exception.xslt +++ b/templates/Lite/Exception.xslt @@ -20,12 +20,9 @@ Сообщение об ошибке:
+ ID ошибки: +
- -
-										
-									
-