Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug logs from NServiceBus and application code not showing up #30

Open
timbussmann opened this issue Sep 3, 2021 · 0 comments
Open

Comments

@timbussmann
Copy link
Contributor

timbussmann commented Sep 3, 2021

The default log level for Azure Functions is set to Information. When lowering this level in the hosts.json to Debug, e.g.

{
    "version": "2.0",
    "logging": {
      "logLevel": {
        "default": "Debug"
      }
    }
}

debug log statements from NServiceBus, but also from user code that is using the logger retrieved via executionContext.GetLogger does not show up.

There is a corresponding issue in Microsoft's azure functions worker repo: Azure/azure-functions-dotnet-worker#573 (marked as duplicate of Azure/azure-functions-dotnet-worker#1125). This doesn't seem to be a NServiceBus related problem as this repro-sample doesn't use NSB at all.


The workaround to get the debug log statements working is to configure the logger on the host builder configuration in addition to the hosts.json:

var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults()
    .ConfigureLogging(l =>
    {
        l.SetMinimumLevel(LogLevel.Debug);
    })
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants