add docs in reaction to aspnet/AspNetCore#8974 (#11945) (#12297)

* add docs in reaction to aspnet/AspNetCore#8974

* Update aspnetcore/signalr/configuration.md

Co-Authored-By: anurse <andrew@stanton-nurse.com>

* feedback

* Apply suggestions from code review

Co-Authored-By: anurse <andrew@stanton-nurse.com>

* update ms.date metadata value
pull/12300/head
Scott Addie 2019-05-06 10:55:54 -05:00 committed by GitHub
parent aa8e2f4a6f
commit 78620c3fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 1 deletions

View File

@ -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.