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)) {