diff --git a/aspnetcore/signalr/configuration.md b/aspnetcore/signalr/configuration.md index dc1a247444..c97957099e 100644 --- a/aspnetcore/signalr/configuration.md +++ b/aspnetcore/signalr/configuration.md @@ -5,7 +5,7 @@ description: Learn how to configure ASP.NET Core SignalR apps. monikerRange: '>= aspnetcore-2.1' ms.author: bradyg ms.custom: mvc -ms.date: 02/07/2019 +ms.date: 04/15/2019 uid: signalr/configuration --- # ASP.NET Core SignalR configuration @@ -162,6 +162,31 @@ let connection = new signalR.HubConnectionBuilder() .build(); ``` +::: moniker range=">= aspnetcore-3.0" + +Instead of a `LogLevel` value, you can also provide a `string` value representing a log level name. This is useful when configuring SignalR logging in environments where you don't have access to the `LogLevel` constants. + +```javascript +let connection = new signalR.HubConnectionBuilder() + .withUrl("/myhub") + .configureLogging("warn") + .build(); +``` + +The following table lists the available log levels. The value you provide to `configureLogging` sets the **minimum** log level that will be logged. Messages logged at this level, **or the levels listed after it in the table**, will be logged. + +| string | LogLevel | +| - | - | +| `"trace"` | `LogLevel.Trace` | +| `"debug"` | `LogLevel.Debug` | +| `"info"` **or** `"information"` | `LogLevel.Information` | +| `"warn"` **or** `"warning"` | `LogLevel.Warning` | +| `"error"` | `LogLevel.Error` | +| `"critical"` | `LogLevel.Critical` | +| `"none"` | `LogLevel.None` | + +::: moniker-end + > [!NOTE] > To disable logging entirely, specify `signalR.LogLevel.None` in the `configureLogging` method.