added logging for startup issues

This commit is contained in:
Shaun Walker
2021-07-01 07:37:03 -04:00
parent 5268c326a1
commit eea417ff44
16 changed files with 203 additions and 67 deletions

View File

@ -46,18 +46,14 @@ namespace Oqtane.Infrastructure
public void Log(int siteId, LogLevel level, object @class, LogFunction function, Exception exception, string message, params object[] args)
{
Log log = new Log();
if (siteId == -1)
log.SiteId = siteId;
if (log.SiteId == -1 && _alias != null)
{
log.SiteId = null;
if (_alias != null)
{
log.SiteId = _alias.SiteId;
}
}
else
{
log.SiteId = siteId;
log.SiteId = _alias.SiteId;
}
if (log.SiteId == -1) return; // logs must be site specific
log.PageId = null;
log.ModuleId = null;
log.UserId = null;
@ -125,9 +121,10 @@ namespace Oqtane.Infrastructure
{
_logs.AddLog(log);
}
catch
catch (Exception ex)
{
// an error occurred writing to the database
var x = ex.Message;
}
}
}