* 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 valuepull/12300/head
parent
aa8e2f4a6f
commit
78620c3fbc
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue