Skip to content

Commit 96179c3

Browse files
committed
docs: remove numbers from logging section
1 parent 0925f19 commit 96179c3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/docs/operator/logging.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ sidebar_position: 6
66

77
# Logging, Tracing, and OpenTelemetry
88

9-
## 1. Logging with `ILogger` and Scopes
9+
## Logging with `ILogger` and Scopes
1010

1111
This project uses Microsoft's [`ILogger`](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging) interface for logging. It provides a standardized and extensible way to capture events within the application.
1212

13-
Using *scopes* enables hierarchical organization of log messages and allows contextual information to be attached to each entry.
13+
Using _scopes_ enables hierarchical organization of log messages and allows contextual information to be attached to each entry.
1414

15-
### 1.1 ILogger Basics
15+
### ILogger Basics
1616

1717
The `ILogger` interface is part of [`Microsoft.Extensions.Logging`](https://www.nuget.org/packages/Microsoft.Extensions.Logging) and provides methods to log messages at various severity levels (e.g., `Information`, `Warning`, `Error`).
1818

1919
Logging can be enabled using either `WebApplication.CreateBuilder`, `Host.CreateDefaultBuilder`, or the `AddLogging` extension method on the `IServiceCollection`.
2020

2121
You can log from your code by injecting `ILogger<MyEntityController>` (or a similar type) into your component.
2222

23-
### 1.2 Using Scopes
23+
### Using Scopes
2424

2525
Scopes define a logical boundary in which all log entries are automatically enriched with contextual metadata. This is especially useful for correlating logs related to a specific request or operation.
2626

@@ -78,7 +78,7 @@ To enable scopes with OpenTelemetry, configure it as follows:
7878
The scope state must be an `IReadOnlyDictionary<string, object?>` to ensure correct serialization and inclusion in log entries.
7979
:::
8080

81-
## 2. Tracing with `System.Diagnostics` and `ActivitySource`
81+
## Tracing with `System.Diagnostics` and `ActivitySource`
8282

8383
For [distributed tracing](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-concepts), this project uses `System.Diagnostics` in combination with `ActivitySource`.
8484
Activities can be started using `ActivitySource.StartActivity`.
@@ -110,9 +110,10 @@ builder.Services
110110
.AddService(serviceName: OperatorName, serviceVersion: "1.0.0"))
111111
.AddSource(OperatorName));
112112
```
113+
113114
:::
114115

115-
## 3. OpenTelemetry Configuration for Azure Logging
116+
## OpenTelemetry Configuration for Azure Logging
116117

117118
To use OpenTelemetry with Azure, it is recommended to adopt the [Azure Monitor OpenTelemetry Distro](https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable).
118119
You can enable it via code:
@@ -123,7 +124,7 @@ builder.Services
123124
.UseAzureMonitor();
124125
```
125126

126-
### 3.2 Full Example Configuration in `Program.cs` (or `Startup.cs`)
127+
### Full Example Configuration in `Program.cs` (or `Startup.cs`)
127128

128129
A complete setup with logging, tracing, and OpenTelemetry might look like this:
129130

@@ -174,4 +175,4 @@ builder
174175
.AddService(serviceName: OperatorName, serviceVersion: "1.0.0"))
175176
.AddSource(OperatorName))
176177
.UseAzureMonitor();
177-
```
178+
```

0 commit comments

Comments
 (0)