1
votes

This is a similar post to Azure Web App Trace logs not appearing in log, however the original poster seems to have abandoned the question without resolving/accepting an answer.

I am trying to trace an issue that only happens on the Azure web app (now called app service). I'm unable to perform any remote debugging due to our company policies, so tracing is our best tool.

However, I've tried following various tutorials, but I still can't seem to get any of my trace information logged.

I've tried:

  1. Setting the Application Logging (Filesystem) Level to Verbose, Information, Error -- nothing.

  2. Looking for the logs in

    • the FTP server at /LogFiles/Application
    • the KUDU interface at https://.scm.azurewebsites.net and again, navigated to /LogFiles/Application
    • portal's Monitoring > Live stream (the section under Diagnostic Logs for the website)

Nada. I've even waited a few hours (thinking it might be a delay), and still nothing.

  1. I setup a very basic hello world ASPX and all it does (in the Page_Load) is try to write 'hello' to the trace log using

    • Trace.TraceError
    • Trace.TraceInformation
    • Trace.TraceWarning
    • Trace.WriteLine
    • Console.Out.WriteLine
    • Console.Error.WriteLine
  2. Some weird stuff I've also tried

    • setting my debug=true in my web.config
    • setting CustomErrors from RemoteOnly to Off
    • trying to use System.Diagnostics.TextWriterTraceListener

Anyone have any ideas I might try?

1
You sure you're not looking in the wrong Web App for those logs? I mean, if you're deploying to a slot, you should look for the logs under that slot.evilSnobu
Well, I was pretty sure 12 hours ago, but at this point, I'm willing to consider anything. I'm not quite sure what you mean by 'slots', though? We're deploying via FTP -- and there's really only one website/app service we've created for this...? Appreciate if you can point me to where I can verify this?jnghh
Here's the relevant doc page - docs.microsoft.com/en-us/azure/app-service/…evilSnobu
If you are able to repro this is a clean new app with just a hello.aspx, please share the app name to help investigation.David Ebbo
@evilSnobu, hm, we've no slots configured, so I'm guessing there's only one place logs could go, and only one place where I could check.jnghh

1 Answers

-1
votes

Exceptions in your live web app are reported by Application Insights. You can correlate failed requests with exceptions and other events at both the client and server, so that you can quickly diagnose the causes. You may refer this article: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-exceptions.

If you use NLog, log4Net or System.Diagnostics.Trace for diagnostic tracing in your ASP.NET application, you can have your logs sent to Azure Application Insights, where you can explore and search them. Your logs will be merged with the other telemetry coming from your application, so that you can identify the traces associated with servicing each user request, and correlate them with other events and exception reports. You may refer this article: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-trace-logs.