I am trying to use Trace Logging in Azure with a Asp.Net Core 2 API. I have an AppService and have gone to the Diagnostics Logs section and enabled Applicationo Logging (Blob) and as per this documentation that should be all I need to do? I have made the following endpoints to test this:
[AllowAnonymous]
[Route("api/TraceWarning")]
public async Task<IActionResult> TraceWarning()
{
Trace.TraceWarning("This is a TraceWarning Message");
return Ok();
}
[AllowAnonymous]
[Route("api/TraceError")]
public async Task<IActionResult> TraceError()
{
Trace.TraceError("This is a TraceError Message");
return Ok();
}
[AllowAnonymous]
[Route("api/ThrowError")]
public async Task<IActionResult> ThrowError()
{
throw new Exception("THROW ERROR");
return Ok();
}
The application logs show the end points getting hit, and show the stack trace for the error, that's great but I'm not getting the messages.
I've tried a lot of different stuff from different searches/guides, but just can't seem to get it to work.
My only conclusion is that I must be missing config of some kind somewhere. Such as, do I need to change my web config (the docs don't say to but I've seen that elsewhere)? What should the LogLevel be in my appsettings.json? Am I forced to fully integrate with Application Isights (and how would I do that)? Would there need to be other code beyond just writing the trace that I need to include at startup?
Thank you for any help, this kind of has me at the end of my ropes.