#SharePointProblems | Koskila.net

Solutions are worthless unless shared! Antti K. Koskela's Personal Professional Blog

How to enable verbose logging for Azure Functions?

koskila
Reading Time 4 min
Word Count 555 words
Comments 5 comments
Rating n/a (0 votes)
View

This post describes how you can easily enable debug/verbose information for your Azure Functions for a lightweight and built-in way to extract just a bit more information out of your Azure Function executions.

There are different methods available for Azure and your local development environment.

Problem

Azure Functions are awesome. But by default, your tools for gathering information without some additional configuration are not that great. The "monitor" view of the function doesn't give you more than an excerpt of the console.

This applies not only to the "production" Azure cloud environment, where the function invocation log is very concise, and even Kudu exposes very simple logging information. Additionally, this applies pretty much completely to your local development environment as well!

However, you can extract a bit more information by enabling verbose logging. Sometimes that might be just enough to get that additional tidbit of information, that'll help you figure out the issue!

Solution

Okay - so it's a minor improvement, but worth documenting. Changing your host.json file for your Azure Functions app (local or in Azure Functions app) allows you to enable verbose logging for your functions.

Solution for Azure:

Modify the host.json file in the cloud

  1. You'll need to add this to the host.json file:

    <pre lang="xml">{   ...   "tracing":   {    "consoleLevel": "verbose"   } } </pre>

  2. To do that, you'll need to access the file system of your (Functions) app service. You can get there by following this path:

    Azure Portal > Function Apps > [Your Function App] > Platform Features > Advanced Tools (Kudu) > Tools > PowerShell

  3. And then open the following directory:

    <pre>site > wwwroot > host.json</pre>

    Kind of a shorthand way would be to jump directly to this address:

    https://[contosofunctionappsite].scm.azurewebsites.net/DebugConsole/?shell=powershell

  4. Alternatively, you could also just use ftp to do that and navigate to the same folder- as shown below:

    host.json file location in Azure Functions app using ftp.
    host.json file location in Azure Functions app using ftp.

  5. Once you have the file open, no matter which way, make sure to update the file so that it contains the tracing level set to verbose.

    {  
       "queues": {  
         "maxPollingInterval": 1000  
       },  
       "tracing":  
      {  
       "consoleLevel": "verbose",  
       "fileLoggingMode": "debugOnly"  
      }  
     }  
     

    It should look something like the below:

    TracingLevel set to verbose in host.json
    TracingLevel set to verbose in host.json

Remember to restart your function app to apply the changes! Just saving the file is not enough, they won't take action until the IIS instance behind the (function) app service is recycled.

Remember to restart your (Function) app service after changing the host.json file - otherwise your changes won't get applied until it restarts automatically!

Remember to restart your (Function) app service after changing the host.json file - otherwise, your changes won't get applied until it restarts automatically!

Solution for the local environment: modify host.json in your solution

Okay - so this is very similar to what you need to do in Azure. Just instead of fishing out the host.json file from Azure, open it from Visual Studio:

How to find host.json in your Visual Studio solution

How to find host.json in your Visual Studio solution

And just like on Azure, you add this in the file:

{
 ...
  "tracing": 
  {
   "consoleLevel": "verbose"
  }
}

And the next time you should have more logging!

References and additional information

Copy-pasting these here, so that I can finally close the browser tabs I have these open on.

Different logging levels:

Value What it does?
Off Nothing at all!
Error error-handling messages
Warning Warnings & errors
Info Info, warnings, errors
Verbose All logging - when tracking an error, you probably wnat this.

Sources:

Comments

Interactive comments not implemented yet. Showing legacy comments migrated from WordPress.
2019-12-04 18:56:19)
Thank you for that, Antti! Congratulations on your MVP accolade!
2019-12-06 22:21:58
Huge thanks, Lukas! Appreciate the sparring and collaboration over the last years! :)
Tim
2020-01-15 00:17:23)
So, where exactly do I find where this is logging to?
2020-01-24 00:04:10
Hi Tim, Locally > Directly to console In Azure > In the associated Application Insights instance, although you obviously get SOME logging in the "Monitor" section of each function, and by accessing "LogFiles" folder with Kudu. Hope this clarifies it!
Whitewater Magpie Ltd.
© 2025
Static Site Generation timestamp: 2025-08-21T07:25:12Z