修改BUG:Exceptions保存时更改为DataAccess.Exceptions,Period字段不进行保存
This commit is contained in:
parent
dfe6841f2f
commit
af1af907a8
|
@ -35,16 +35,18 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
/// <returns></returns>
|
||||
public override bool Log(Exception ex, NameValueCollection additionalInfo)
|
||||
{
|
||||
var excep = new Exceptions();
|
||||
excep.Id = null;
|
||||
excep.AppDomainName = AppDomain.CurrentDomain.FriendlyName;
|
||||
excep.ErrorPage = additionalInfo?["ErrorPage"];
|
||||
excep.ExceptionType = ex.GetType().FullName;
|
||||
excep.LogTime = DateTime.Now;
|
||||
excep.Message = ex.Message;
|
||||
excep.StackTrace = ex.StackTrace;
|
||||
excep.UserId = additionalInfo?["UserId"];
|
||||
excep.UserIp = additionalInfo?["UserIp"];
|
||||
var excep = new DataAccess.Exceptions
|
||||
{
|
||||
Id = null,
|
||||
AppDomainName = AppDomain.CurrentDomain.FriendlyName,
|
||||
ErrorPage = additionalInfo?["ErrorPage"],
|
||||
ExceptionType = ex.GetType().FullName,
|
||||
LogTime = DateTime.Now,
|
||||
Message = ex.Message,
|
||||
StackTrace = ex.StackTrace,
|
||||
UserId = additionalInfo?["UserId"],
|
||||
UserIp = additionalInfo?["UserIp"]
|
||||
};
|
||||
MongoDbAccessManager.Exceptions.InsertOne(excep);
|
||||
ClearExceptions();
|
||||
return true;
|
||||
|
|
|
@ -206,6 +206,7 @@ namespace Bootstrap.DataAccess.MongoDB
|
|||
md.AutoMap();
|
||||
md.IdMemberMap.SetSerializer(new StringSerializer(BsonType.ObjectId));
|
||||
md.IdMemberMap.SetIgnoreIfDefault(true);
|
||||
md.UnmapMember(ex => ex.Period);
|
||||
});
|
||||
}
|
||||
if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.Log)))
|
||||
|
|
Loading…
Reference in New Issue