Skip to content

Commit 62246c7

Browse files
authored
Update dotnet-isolated-process-guide.md
Added a warning about log category names with a `.` character.
1 parent ac9b534 commit 62246c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

articles/azure-functions/dotnet-isolated-process-guide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,13 @@ public class MyFunction {
807807
}
808808
```
809809

810+
> [!NOTE]
811+
> Loggers obtained through dependency injection are associated with a log category set to the fully qualified name of the class.
812+
> This usually consists in a category name with one or more `.` (period) characters.
813+
> When hosting your function app on Linux App Service plans, please be aware of
814+
> [limitations with category names that contain a dot](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=bash#set-log-level-by-command-line-environment-variables-and-other-configuration). You will not be able to override
815+
> log levels for those categories using environment variables.
816+
810817
The logger can also be obtained from a [FunctionContext] object passed to your function. Call the [GetLogger<T>] or [GetLogger] method, passing a string value that is the name for the category in which the logs are written. The category is usually the name of the specific function from which the logs are written. To learn more about categories, see the [monitoring article](functions-monitoring.md#log-levels-and-categories).
811818

812819
Use the methods of [`ILogger<T>`][ILogger&lt;T&gt;] and [`ILogger`][ILogger] to write various log levels, such as `LogWarning` or `LogError`. To learn more about log levels, see the [monitoring article](functions-monitoring.md#log-levels-and-categories). You can customize the log levels for components added to your code by registering filters:

0 commit comments

Comments
 (0)