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