Closed samirbanjanovic closed 5 years ago
Nothing immediately comes to mind, @SamirBanjanovic - I hope you found some clues somewhere. Closing as this issue is now a bit stale, but if you did end up tracking this down to something Serilog-related please let us know :-)
There could be a simple answer to this, and to be honest it seems to me to be context related. However, I figured I'd post here see if it get's a conversation started. In my scenario I have a class which hosts the LoggerFactory and is used to create a logger
Logging works as expected as long as I am awaiting all my async methods or the method is synchronous. But, when I call
_logger
from a task I am not seeing those entries come through.The code below yields now log entry:
I was able to get log entries to work by creating another logger within the
Configure()
method scope:var scopedLogger = _loggerFactory.CreateLogger("ConfigurationLogger");
and callingscopedLogger
from within the Task.I am curious to what I am missing or if this is a legit issue