修改BUG:Exceptions.Log方法内部ErrorPage使用nameof(ex)导致结果为ex字符串
This commit is contained in:
parent
8dd9c3e773
commit
b2b69bb771
|
@ -44,7 +44,7 @@ namespace Bootstrap.DataAccess.SQLite
|
|||
["ErrorPage"] = null
|
||||
};
|
||||
}
|
||||
var errorPage = additionalInfo["ErrorPage"] ?? (nameof(ex).Length > 50 ? nameof(ex).Substring(0, 50) : nameof(ex));
|
||||
var errorPage = additionalInfo["ErrorPage"] ?? ex.GetType().Name;
|
||||
var sql = "insert into Exceptions (AppDomainName, ErrorPage, UserID, UserIp, ExceptionType, Message, StackTrace, LogTime) values (@AppDomainName, @ErrorPage, @UserID, @UserIp, @ExceptionType, @Message, @StackTrace, datetime('now', 'localtime'))";
|
||||
using (DbCommand cmd = DbAccessManager.DBAccess.CreateCommand(CommandType.Text, sql))
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace Bootstrap.DataAccess
|
|||
["ErrorPage"] = null
|
||||
};
|
||||
}
|
||||
var errorPage = additionalInfo["ErrorPage"] ?? (nameof(ex).Length > 50 ? nameof(ex).Substring(0, 50) : nameof(ex));
|
||||
var errorPage = additionalInfo["ErrorPage"] ?? (ex.GetType().Name.Length > 50 ? ex.GetType().Name.Substring(0, 50) : ex.GetType().Name);
|
||||
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.DBAccess.CreateCommand(CommandType.Text, sql))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue