Logs are persisted, by default, at the end of the HTTP Request.
If we start a background job, the log messages will not be persisted, because the HTTP Request will have already been finished by that time.
Possible quick fix is to update the LocalTextFileListener to write the logs as soon as they are provided.
KissLogApiListener (cloud listener) do needs to be instructed manually to persist the logs.
Task.Factory.StartNew(async () => {
List<Task> tasks = new List<Task>();
foreach (var item in mails)
{
Task task = _emailsService.SendEmailAsync(EmailType.ApplicationCreated, item.Model, item.To, true);
tasks.Add(task);
}
await Task.WhenAll(tasks);
});
Logs are persisted, by default, at the end of the HTTP Request.
If we start a background job, the log messages will not be persisted, because the HTTP Request will have already been finished by that time.
Possible quick fix is to update the LocalTextFileListener to write the logs as soon as they are provided.
KissLogApiListener (cloud listener) do needs to be instructed manually to persist the logs.