Skip to content

Commit 3738fa3

Browse files
authored
[template] Make README Logging section consistent (Azure#14022)
* [template] Make README Logging section consistent We might have introduced the inconsistency for some libraries while copying content from other languages. * Update other README files Contents for messaging libraries (Event Hub/Service Bus) remain unchanges because they are different in having additional information about `rhea` logging. * linking to logger
1 parent f540b4e commit 3738fa3

File tree

15 files changed

+58
-50
lines changed

15 files changed

+58
-50
lines changed

sdk/anomalydetector/ai-anomaly-detector/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,18 @@ More Samples can be found [here](https://github.com/Azure/azure-sdk-for-js/tree/
157157

158158
## Troubleshooting
159159

160-
### Enable logs
160+
### Logging
161161

162-
You can set the following environment variable to see debug logs when using this library.
162+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
163163

164-
- Getting debug logs from the Azure Anomaly Detector client library
164+
```javascript
165+
import { setLogLevel } from "@azure/logger";
165166

166-
```bash
167-
export DEBUG=azure*
167+
setLogLevel("info");
168168
```
169169

170+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
171+
170172
## Next steps
171173

172174
Please take a look at the

sdk/attestation/attestation/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ This SDK provides the following functionality for the Microsoft Azure Attestatio
2828

2929
## Troubleshooting
3030

31-
### Enable logs
31+
### Logging
3232

33-
You can set the following environment variable to get the debug logging output when using this library.
33+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
3434

35-
- Getting debug logs from the Azure Attestation client library
35+
```javascript
36+
import { setLogLevel } from "@azure/logger";
3637

37-
```bash
38-
export AZURE_LOG_LEVEL=verbose
38+
setLogLevel("info");
3939
```
4040

41+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
42+
4143
## Next steps
4244

4345
## Contributing

sdk/core/core-amqp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Some of the key features of Azure Core AMQP library are:
3131

3232
The core-amqp library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, and for sending and receiving events over the [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol.
3333

34-
### Enable logs
34+
### Logging
3535

3636
You can set the `AZURE_LOG_LEVEL` environment variable to one of the following values to enable logging to `stderr`:
3737

sdk/core/core-lro/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ You will be able to find some working examples of an implementation of an operat
6060

6161
## Troubleshooting
6262

63-
### Enable logs
63+
### Logging
6464

6565
Logs can be added at the discretion of the library implementing the Long Running Operation poller.
6666
Packages inside of [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) use

sdk/digitaltwins/digital-twins-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ directory for detailed examples on how to use this library.
124124
125125
## Troubleshooting
126126
127-
### Enable logs
127+
### Logging
128128
129129
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
130130

sdk/eventgrid/eventgrid/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,14 @@ receiver.subscribe({
266266

267267
## Troubleshooting
268268

269-
### Enable logs
269+
### Logging
270270

271-
You can set the following environment variable to get the debug logging output when using this library.
271+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
272272

273-
- Getting debug logs from the Azure Event Grid client library
273+
```javascript
274+
import { setLogLevel } from "@azure/logger";
274275

275-
```bash
276-
export AZURE_LOG_LEVEL=verbose
276+
setLogLevel("info");
277277
```
278278

279279
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

sdk/eventhub/event-hubs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ main();
450450

451451
The Event Hubs library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving events over the [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol.
452452

453-
### Enable logs
453+
### Logging
454454

455455
You can set the `AZURE_LOG_LEVEL` environment variable to enable logging to `stderr`:
456456

sdk/eventhub/eventhubs-checkpointstore-blob/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ main();
140140

141141
## Troubleshooting
142142

143-
### Enable logs
143+
### Logging
144144

145145
You can set the `AZURE_LOG_LEVEL` environment variable to one of the following values to enable logging to `stderr`:
146146

sdk/formrecognizer/ai-form-recognizer/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,14 @@ main().catch((err) => {
435435

436436
## Troubleshooting
437437

438-
### Enable logs
438+
### Logging
439439

440-
You can set the following environment variable to see debug logs when using this library.
440+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
441441

442-
- Getting debug logs from the Azure Form Recognizer client library
442+
```javascript
443+
import { setLogLevel } from "@azure/logger";
443444

444-
```bash
445-
export DEBUG=azure*
445+
setLogLevel("info");
446446
```
447447

448448
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

sdk/metricsadvisor/ai-metrics-advisor/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,16 +472,18 @@ async function queryAnomaliesByAlert(client, alert) {
472472

473473
## Troubleshooting
474474

475-
### Enable logs
475+
### Logging
476476

477-
You can set the following environment variable to see debug logs when using this library.
477+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
478478

479-
- Getting debug logs from the Azure MetricsAdvisor client library
479+
```javascript
480+
import { setLogLevel } from "@azure/logger";
480481

481-
```bash
482-
export DEBUG=azure*
482+
setLogLevel("info");
483483
```
484484

485+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
486+
485487
## Next steps
486488

487489
Please take a look at the

0 commit comments

Comments
 (0)