Skip to content

Commit 17ae548

Browse files
committed
Clarify logging category behavior and environment variable limitations for ILogger in Linux hosting
1 parent 4a2e9f4 commit 17ae548

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -829,11 +829,7 @@ public class MyFunction {
829829
```
830830

831831
> [!NOTE]
832-
> Loggers obtained through dependency injection are associated with a log category set to the fully qualified name of the class.
833-
> This usually consists in a category name with one or more `.` (period) characters.
834-
> When hosting your function app on Linux App Service plans, please be aware of
835-
> [limitations with category names that contain a dot](/dotnet/core/extensions/logging?tabs=bash#set-log-level-by-command-line-environment-variables-and-other-configuration). You will not be able to override
836-
> log levels for those categories using environment variables.
832+
> When you inject an `ILogger<T>` in your class constructor, like the previous example, the log category is automatically set to the fully qualified name of that class, such as `MyFunctionApp.MyFunction`. These category names contain `.` (period) characters. When you host your function app on Linux, you can't use environment variables to override log levels for categories that contain periods. To work around this limitation, you can instead [configure log levels in your code](#managing-log-levels) or in an `appsettings.json` file.
837833

838834
You can also get the logger from a [FunctionContext] object passed to your function. Call the [GetLogger&lt;T&gt;] 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. For more information about categories, see the [monitoring article](functions-monitoring.md#log-levels-and-categories).
839835

0 commit comments

Comments
 (0)