Log errors by jobs #4353
-
Hello, _logManager.Log(site.SiteId, LogLevel.Error, this, LogFunction.Other, "message"); I absolutely need to do this, in addition to logging from the job, to expose information, warnings and errors on my dashboard. Unfortunately, in case of an error Oqtane sends a notification, but using getAlias method from the job without httpcontext causes an exception and prevents me from inserting it. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
@pnicosia80 in your scheduled job you could call TenantManager.SetAlias(tenantid, siteid) to ensure the Alias is set - which would avoid the exception in the SendNotification method. |
Beta Was this translation helpful? Give feedback.
-
@pnicosia80 I do agree with your suggestion that this logging logic could be more defensive to prevent exceptions. |
Beta Was this translation helpful? Give feedback.
-
@pnicosia80 #4356 addresses your issue:
|
Beta Was this translation helpful? Give feedback.
-
@sbwalker Thanks! I have resolved the issue of error logging from the job. |
Beta Was this translation helpful? Give feedback.
@pnicosia80 #4356 addresses your issue: