From 43796875af871301b7fb03fd6a71bde9154dc513 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Fri, 28 Sep 2018 09:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=9A?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=8A=A0=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=B1=BB=E5=9E=8B=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/wwwroot/js/exceptions.js | 3 ++- Bootstrap.DataAccess/ExceptionHelper.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/js/exceptions.js b/Bootstrap.Admin/wwwroot/js/exceptions.js index 20ce6dd8..66f619fd 100644 --- a/Bootstrap.Admin/wwwroot/js/exceptions.js +++ b/Bootstrap.Admin/wwwroot/js/exceptions.js @@ -15,7 +15,8 @@ { title: "请求网址", field: "ErrorPage", sortable: true }, { title: "用户名", field: "UserId", sortable: true }, { title: "IP", field: "UserIp", sortable: true }, - { title: "错误", field: "Message", sortable: false }, + { title: "异常类型", field: "ExceptionType", sortable: false }, + { title: "异常描述", field: "Message", sortable: false }, { title: "记录时间", field: "LogTime", sortable: true } ] }); diff --git a/Bootstrap.DataAccess/ExceptionHelper.cs b/Bootstrap.DataAccess/ExceptionHelper.cs index 30ed2dbb..109dbc9e 100644 --- a/Bootstrap.DataAccess/ExceptionHelper.cs +++ b/Bootstrap.DataAccess/ExceptionHelper.cs @@ -29,7 +29,7 @@ namespace Bootstrap.DataAccess /// public static void Log(Exception ex, NameValueCollection additionalInfo) { - var errorPage = additionalInfo["ErrorPage"] ?? (ex.Message.Length > 50 ? ex.Message.Substring(0, 50) : ex.Message); + var errorPage = additionalInfo["ErrorPage"] ?? (nameof(ex).Length > 50 ? nameof(ex).Substring(0, 50) : nameof(ex)); var sql = "insert into Exceptions (AppDomainName, ErrorPage, UserID, UserIp, ExceptionType, Message, StackTrace, LogTime) values (@AppDomainName, @ErrorPage, @UserID, @UserIp, @ExceptionType, @Message, @StackTrace, GetDate())"; using (DbCommand cmd = DBAccessManager.SqlDBAccess.CreateCommand(CommandType.Text, sql)) {