Exception GUIDs implemented

main
Inga 🏳‍🌈 14 years ago
parent e84f40b615
commit cc4ff3ab55
  1. 2
      Builder/IISMainHandler/build.txt
  2. 7
      Common/UserContext.cs
  3. 4
      IISMainHandler/WebContext.cs
  4. 7
      templates/Full/Exception.xslt
  5. 7
      templates/Lite/Exception.xslt

@ -60,11 +60,16 @@ namespace FLocal.Common {
);
}
public static Guid GetGuid(this Exception exception) {
return Core.Cache<Guid>.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())
);
}

@ -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);

@ -20,12 +20,9 @@
<xsl:text>Ñîîáùåíèå îá îøèáêå: </xsl:text>
<xsl:value-of select="exception/message"/>
<br/>
<xsl:text>ID îøèáêè: </xsl:text>
<xsl:value-of select="exception/guid"/>
<br/>
<font size="-3">
<pre>
<xsl:value-of select="exception/trace"/>
</pre>
</font>
</td>
</tr>
</table>

@ -20,12 +20,9 @@
<xsl:text>Ñîîáùåíèå îá îøèáêå: </xsl:text>
<xsl:value-of select="exception/message"/>
<br/>
<xsl:text>ID îøèáêè: </xsl:text>
<xsl:value-of select="exception/guid"/>
<br/>
<font size="-3">
<pre>
<xsl:value-of select="exception/trace"/>
</pre>
</font>
</td>
</tr>
</table>

Loading…
Cancel
Save