Reputation: 638
I have an Azure Function with AzureFunctionVersion v3 and for some time now I don't see any logs in Application Insights or in the Rider Console that are not logged in the FunctionTrigger itself.
[FunctionName("test")]
public IActionResult Test([HttpTrigger(AuthorizationLevel.Function, "delete", Route = BasePath + "/{roomId}")] HttpRequest req,
ILogger log)
{
log.LogInformation("Log is shown");
myservice.DoIt();
}
namespace MyApp.Test.Service {
public MyService(ILoggerFactory loggerFactory)
{
_log = loggerFactory.CreateLogger(GetType().Namespace);
}
public void DoIt() {
_log.LogInformation("Log is not shown");
}
}
My host.json looks like:
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": false
}
},
"logLevel": {
"MyApp.*": "Information"
}
}
Upvotes: 3
Views: 2196
Reputation: 29940
Please try to change the logLevel
in one of the following ways:
"logLevel": {"MyApp": "Information"}
"logLevel": { "Default": "Information" }
Upvotes: 6