-
Notifications
You must be signed in to change notification settings - Fork 155
Docs: remove logEvent
parameter from Logger constructor setting
#1814
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
Comments
Hi @bestickley, thank you for opening the issue. The documentation is wrong and we'll use this issue to fix it. The This is because we can only log the event when the handler is wrapped by the decorator or middleware. If we allowed the setting in the constructor, this could make customers think that by simply enabling the option Logger will log the event, which is not the case. We do have an environment variable, but that's mostly to disable the behavior without changing the code either in a dev environment or after deployment. With this in mind I'm inclined to consider not a bug, not a feature request, but rather an action point to change the docs. |
I don't quite understand what the process is to log the incoming event. Idea is to surface it easily, ideally in the AWS console for debugging. Could that please be documented too? |
I agree @kaihendry , we can add a small section specifically for logging events. |
Logger
Constructor Missing logEvent
ParameterlogEvent
parameter from Logger constructor setting
Hi @kaihendry - we do have a section dedicated to this feature - which can be found here. When enabled, the feature instructs the logger instance to emit one log at Given that the Logger utility must have access to the function |
I scanned the outline multiple times and missed it 😵💫 |
|
Expected Behaviour
The docs state that

Logger
's constructor accepts alogEvent
parameter to control whether or not logger prints event. But when I try to do this I get an error. See screenshot.Current Behaviour
Cannot pass
logEvent
into constructor ofLogger
.Code snippet
Steps to Reproduce
Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
18.x
Packaging format used
npm
Execution logs
No response
The text was updated successfully, but these errors were encountered: