Azure / Azure/Connectors-NodeJS-SDK
Add structured logging via @azure/logger
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 4
- Avg merge
- 2d 2m
- Merged PRs (30d)
- 14
Description
## Context
The Node SDK has zero logging throughout its infrastructure layer — `ConnectorHttpClient`, `ConnectorClientBase`, and all generated clients are completely silent. The .NET SDK logs via the Azure.Core pipeline automatically at `Info` (request start), `Info` (response received), and `Warning` (retry attempts).
## Proposed change
Add `@azure/logger` with the `azure:connectors:` prefix namespace:
```ts
import { createClientLogger } from "@azure/logger";
const logger = createClientLogger("connectors");
// In ConnectorHttpClient.sendAsync():
logger.info(`→ ${method} ${url}`);
// On response:
logger.info(`← ${response.status} ${method} ${url} (${elapsed}ms)`);
// On retry:
logger.warning(`Retry ${attempt}/${maxRetries} for ${method} ${url} after ${delay}ms`);
// On error:
logger.error(`${method} ${url} failed: ${error.message}`);
```
Consumers opt in to log output by setting:
```
AZURE_LOG_LEVEL=info # or verbose, warning, error
```
This is a **non-breaking additive change** and can be shipped independently of the other infrastructure issues.
## Azure SDK guideline
- [DO use `@azure/logger`](https://azure.github.io/azure-sdk/typescript_design.html#ts-logging)
- Namespace format: `azure:` (e.g., `azure:connectors`)
Contributor guide
Assessment
This issue has not been assessed yet.