generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
bugSomething isn't workingSomething isn't workingcompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedloggerThis item relates to the Logger UtilityThis item relates to the Logger Utility
Description
Expected Behavior
The warning shouldn't appear if persistentLogAttributes is not used
Current Behavior
The warning appears if I pass persistentKeys into createChild function.
P.S. It works well if I call appendPersistentKeys separately
Code snippet
const logger = new Logger();
const child = logger.createChild({persistentKeys: {key: 'value'}});Output:
{"level":"WARN","message":"Both persistentLogAttributes and persistentKeys options were provided. Using persistentKeys as persistentLogAttributes is deprecated and will be removed in future releases","timestamp":"2025-10-08T16:01:25.851Z","service":"service_undefined","sampling_rate":0,"key":"value"}
Steps to Reproduce
- Create Logger
- Create a child with
persistentKeysparam
Possible Solution
- Do not set the default empty object to
persistentLogAttributes - Or change the warning condition
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
22.x
Packaging format used
npm
Execution logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedloggerThis item relates to the Logger UtilityThis item relates to the Logger Utility
Type
Projects
Status
Shipped