event logging fix

This commit is contained in:
Shaun Walker
2019-10-28 09:02:11 -04:00
parent 72c7f4abb0
commit af423edb99
6 changed files with 83 additions and 14 deletions

View File

@ -47,15 +47,17 @@ namespace Oqtane.Infrastructure
log.Url = request.Scheme.ToString() + "://" + request.Host.ToString() + request.Path.ToString() + request.QueryString.ToString();
}
if (Class.GetType() != null)
Type type = Type.GetType(Class.ToString());
if (type != null)
{
log.Category = Class.GetType().AssemblyQualifiedName;
log.Category = type.AssemblyQualifiedName;
log.Feature = Utilities.GetTypeNameLastSegment(log.Category, 0);
}
else
{
log.Category = Class.ToString();
log.Feature = log.Category;
}
log.Feature = Utilities.GetTypeNameLastSegment(log.Category, 0);
log.Function = Enum.GetName(typeof(LogFunction), Function);
log.Level = Enum.GetName(typeof(LogLevel), Level);
if (Exception != null)