5

I am using Azure Web App Application Logging, and I followed the online tutorial, and made the following setup:

Logging configuration settings

I get an exception and in my catch block I have the following code:

Trace.TraceError("abc"); Trace.TraceInformation("abc"); Trace.TraceWarning("abc"); Trace.WriteLine("abc"); Console.WriteLine("abc"); 

In the logs I get this:

2017-02-13 03:30:14 ~1ENGINEMAILERAPI GET /api/vfs/site/wwwroot/ _=1486950157594&X-ARR-LOG-ID=149fee3f-8da3-460e-816e-10e7a4b95f1d 443 - 121.121.23.217 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/56.0.2924.87+Safari/537.36 - https://web1.appsvcux.ext.azure.com/websites/WebsitesContent/WebsitesIndex?cacheability=3&defaultCloudName=azure&extensionName=WebsitesExtension&shellVersion=5.0.302.608%20(production%233ec7ddd.170201-1022)&traceStr=&region=southeastasia&flight=0&defaultCacheEvictionDelay=105000&websitesextension_enablemonitoringgroup=true&websitesextension_newauditlogs=true&websitesextension_resourcemenu=true&websitesextension_seetemplate=true&pageVersion=5.12.32.464175.170208-1137&l=en.en-us&trustedAuthority=portal.azure.com enginemailerapi.scm.azurewebsites.net 200 0 0 992 1923 62

How can I get my application logging to show up?

5
  • 1
    This error you got from FTP or Blob Storage? Also, please check the following doc page learn.microsoft.com/en-us/azure/app-service-web/… Commented Feb 13, 2017 at 5:11
  • @ThiagoCustodio hi dear, i get it from the FTP , and i was totally follow it, may i know if i need to add any trace listener to it? Commented Feb 14, 2017 at 2:46
  • Have you solved this issue, any updates? Commented Feb 20, 2017 at 1:48
  • @Bruce-MSFTnope... i still unable to do it, it wasted too much of time... it probably i created web service myself, when i create a new project, i created as a empty website not azure website, probably this is the cause Commented Feb 22, 2017 at 3:41
  • Are you deploying to a particular deployment slot other than the default (production)? If so, make sure that you are enabling Diagnostic Logs and look in the Log Stream blades from the Deployment Slot blade itself. It happened to me. I enabled logging on the default when I was testing on my "staging" slot. Once I realized my mistake I went to App > Deployment Slots > staging > Diagnostic Logs and voila! logs started streaming right away. Commented Aug 17, 2017 at 0:50

1 Answer 1

1

According to the log format of error message you provided, I assumed that the log file you provided is belongs to Web Server Logs ( under /LogFiles/http/RawLogs) which formatted using W3W Logging. Based on your configuration, you have both enabled file system and blob storage for Application Logging. You could retrieve your application logs as follows:

Application Logging (Filesystem)

For a simple way, you could leverage KUDU, click "Debug console > CMD" and cd LogFiles\Application, then you could retrieve your logs as follows:

Application Logging (Blob)

You could leverage Microsoft Azure Storage Explorer to retrieve your logs as follows:

UPDATE:

enter image description here

enter image description here

Sign up to request clarification or add additional context in comments.

5 Comments

dear, it appear this in the file 2017-02-14T02:19:48 PID[11164] Verbose SnapshotHelper::TakeSnapshotTimerCallback 2017-02-14T02:19:48 PID[11164] Verbose SnapshotHelper::TakeSnapshotInternal - no new files in CodeGen
Are you mean that you couldn't retrieve your custom error message in the application log file? I used System.Diagnostics.Trace.TraceError and I could retrieve my logs. I assumed that there may be a delay for log to be generated, you could wait for a while and refresh your KUDU site or storage tool to see whether you could retrieve your desired error message.
still get the same as 2017-02-14T02:19:48 PID[11164] Verbose SnapshotHelper::TakeSnapshotTimerCallback 2017-02-14T02:19:48 PID[11164] Verbose SnapshotHelper::TakeSnapshotInternal - no new files in CodeGen
this is the content of the file
I found a similar issue mentioned about SnapshotHelper. Also, I have set my applicaiton log level to verbose which could log all information produced by the application, I could retrieve the same verbose message as you provided, please see my updates. I assumed that SnapshotHelper is an Azure thing. I noticed that the time stamp of your logs are the same, you could try to set log level to error and clean your log files, then you could manually throw an exception and try to see whether you could retrieve your custom message.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.