You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v4/logging/dynamic-console-logging.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,34 @@
1
1
# Dynamic Console Logging
2
2
3
-
This logging provider is a wrapper around the [Microsoft Console Logger](https://learn.microsoft.com/dotnet/core/extensions/logging-providers#console). It allows for querying the active loggers and their minimum levels, as well as then modifying the levels dynamically at runtime via the [loggers actuator](../management/loggers.md).
3
+
This logging provider is a wrapper around the [Microsoft Console Logger](https://learn.microsoft.com/dotnet/core/extensions/logging-providers#console). It allows you to:
4
+
5
+
* Query the active loggers and their minimum levels
6
+
* Modify the levels dynamically at runtime using the [loggers actuator](../management/loggers.md)
4
7
5
8
> [!CAUTION]
6
9
> External tool integration involves sending the fully-qualified logger name over HTTP. Avoid using colons in the name of a logger to prevent invalid HTTP requests.
7
10
8
11
## Usage
9
12
10
-
Before starting to use Steeltoe provider, you should know how [Logging in .NET](https://learn.microsoft.com/aspnet/core/fundamentals/logging) works, as Steeltoe provides nothing more than a wrapper around the existing Microsoft console logger.
13
+
Before starting to use Steeltoe provider, you should know how [Logging in .NET](https://learn.microsoft.com/aspnet/core/fundamentals/logging) works; Steeltoe provides nothing more than a wrapper around the existing Microsoft console logger.
11
14
12
-
To use the Steeltoe logging provider, you need to:
15
+
To use the Steeltoe logging provider:
13
16
14
17
1. Add the appropriate NuGet package reference to your project.
15
-
1. Configure logging settings.
16
-
1. Add the dynamic logging provider to the logging builder.
18
+
2. Configure logging settings.
19
+
3. Add the dynamic logging provider to the logging builder.
17
20
18
21
### Add NuGet References
19
22
20
-
To use the logging provider, you need to add a reference to the `Steeltoe.Logging.DynamicConsole` NuGet package.
23
+
To use the logging provider, add a reference to the `Steeltoe.Logging.DynamicConsole` NuGet package.
21
24
22
25
### Configure Settings
23
26
24
-
As mentioned earlier, the Steeltoe Logging provider is a wrapper around the Microsoft Console logging provider. Consequently, you can configure it the same way you would the Microsoft provider. For more details on how this is done, see [Configure logging](https://learn.microsoft.com/aspnet/core/fundamentals/logging#configure-logging).
27
+
The Steeltoe Logging provider is a wrapper around the Microsoft Console logging provider, so you can configure it the same way you would the Microsoft provider. For more details about how to do this, see [Configure logging](https://learn.microsoft.com/aspnet/core/fundamentals/logging#configure-logging).
25
28
26
29
### Add the Logging Provider
27
30
28
-
To use the provider, you need to add it to the logging builder by using the `AddDynamicConsole()` extension method:
31
+
To use the provider, add it to the logging builder by using the `AddDynamicConsole()` extension method:
Copy file name to clipboardExpand all lines: api/v4/logging/dynamic-serilog-logging.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
# Dynamic Serilog Logging
2
2
3
-
This logging provider integrates with [Serilog](https://serilog.net/). It enables logger minimum levels configured via Serilog to be queried and modified at runtime via the [loggers actuator](../management/loggers.md).
3
+
This logging provider integrates with [Serilog](https://serilog.net/). It enables logger minimum levels configured through Serilog to be queried and modified at runtime using the [loggers actuator](../management/loggers.md).
4
4
5
5
## Usage
6
6
7
-
To use the Serilog Dynamic Logger, you need to do the following:
7
+
To use the Serilog Dynamic Logger, do the following:
8
8
9
9
1. Add the appropriate NuGet package reference to your project.
10
-
1. Configure Logging settings.
11
-
1. Add the Serilog Dynamic Logger to the logging builder.
10
+
2. Configure Logging settings.
11
+
3. Add the Serilog Dynamic Logger to the logging builder.
12
12
13
13
### Add NuGet References
14
14
15
-
To use the logging provider, you need to add a reference to the `Steeltoe.Logging.DynamicSerilog` NuGet package.
15
+
To use the logging provider, add a reference to the `Steeltoe.Logging.DynamicSerilog` NuGet package.
16
16
17
17
### Configure Settings
18
18
19
-
As mentioned earlier, the Serilog Dynamic Logger provider extends Serilog. Consequently, you can configure it the same way you would Serilog. For more details on how this is done, see [Serilog-Settings-Configuration](https://github.com/serilog/serilog-settings-configuration).
19
+
The Serilog Dynamic Logger provider extends Serilog, so you can configure it the same way you would Serilog. For more information, see [Serilog-Settings-Configuration](https://github.com/serilog/serilog-settings-configuration).
20
20
21
21
```json
22
22
{
@@ -60,7 +60,7 @@ var serilogConfiguration = new LoggerConfiguration()
60
60
61
61
### Add Serilog Dynamic Logger
62
62
63
-
To use this logging provider, you need to add it to the logging builder by using the `AddDynamicSerilog()` extension method:
63
+
To use this logging provider, add it to the logging builder by using the `AddDynamicSerilog()` extension method:
Because dynamic logging is built on the `Microsoft.Extensions.Logging` abstractions, changing log levels dynamically **won't work** if you're using Serilog's static `Log` class directly.
80
+
Because dynamic logging is built on the `Microsoft.Extensions.Logging` abstractions, changing log levels dynamically **doesn't work** if you're using Serilog's static `Log` class directly.
80
81
81
82
```csharp
82
83
usingSerilog;
@@ -103,7 +104,7 @@ var exampleLogger = loggerFactory.CreateLogger("Example");
103
104
exampleLogger.LogInformation("Hello from Example.");
104
105
```
105
106
106
-
The Serilog dynamic logger supports the use of logger scopes, as well as Serilog's enrichers and destructuring.
107
+
The Serilog dynamic logger supports the use of logger scopes, and also Serilog's enrichers and destructuring.
Copy file name to clipboardExpand all lines: api/v4/logging/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,5 +2,5 @@
2
2
3
3
Steeltoe includes two logging providers that enhance existing logger libraries with support for managing minimum log levels at runtime through the [Steeltoe Management logger endpoint](../management/loggers.md) and [recording distributed trace information](../tracing/index.md#log-correlation).
4
4
5
-
*[Dynamic Console Logging](./dynamic-console-logging.md) works with `Microsoft.Extensions.Logging.Console`.
5
+
*[Dynamic Console Logging](./dynamic-console-logging.md) works with `Microsoft.Extensions.Logging.Console`
6
6
*[Dynamic Serilog Logging](./dynamic-serilog-logging.md) works with `Serilog`
0 commit comments