Skip to content

chore: add Logging Service property priority to docs #728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/core/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ Setting | Description | Environment variable | Attribute parameter
**Service** | Sets **Service** key that will be present across all log statements | `POWERTOOLS_SERVICE_NAME` | `Service`
**Logging level** | Sets how verbose Logger should be (Information, by default) | `POWERTOOLS_LOG_LEVEL` | `LogLevel`

### Service Property Priority Resolution

The root level Service property now correctly follows this priority order:

1. LoggingAttribute.Service (property value set in the decorator)
2. POWERTOOLS_SERVICE_NAME (environment variable)


### Example using AWS Serverless Application Model (AWS SAM)

You can override log level by setting **`POWERTOOLS_LOG_LEVEL`** environment variable in the AWS SAM template.
Expand Down Expand Up @@ -788,4 +796,4 @@ To use a custom log formatter with AOT, pass an instance of `ILogFormatter` to `

While we support anonymous type serialization by converting to a `Dictionary<string, object>`, this is **not** a best practice and is **not recommended** when using native AOT.

We recommend using concrete classes and adding them to your `JsonSerializerContext`.
We recommend using concrete classes and adding them to your `JsonSerializerContext`.
Loading