logging enhancements

This commit is contained in:
Shaun Walker
2019-10-24 16:54:14 -04:00
parent b3e010d5e2
commit 3d7ae6a743
36 changed files with 306 additions and 185 deletions

View File

@ -135,7 +135,25 @@ namespace Oqtane.Modules
{
UserId = PageState.User.UserId;
}
await LoggingService.Log(PageId, ModuleId, UserId, this.GetType().ToString(), level, exception, message, args);
string category = this.GetType().AssemblyQualifiedName;
string feature = Utilities.GetTypeNameLastSegment(category, 1);
LogFunction function;
switch (PageState.Action)
{
case "Add":
function = LogFunction.Create;
break;
case "Edit":
function = LogFunction.Update;
break;
case "Delete":
function = LogFunction.Delete;
break;
default:
function = LogFunction.Read;
break;
}
await LoggingService.Log(PageId, ModuleId, UserId, category, feature, function, level, exception, message, args);
}
public class Logger