-
Notifications
You must be signed in to change notification settings - Fork 375
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
Dev: Fix Netlify Functions logging #722
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
- do we know what regression caused logging to stop working?
- can we use the
getLogger()
method oflambda-local
to access the provided winston instance rather than adding our own?
|
Thanks, looks good to me! I’m cool with merging without tests so we can get this released, but a PR with tests should come next - in this case just a test to ensure logs from a function work. Sent with GitHawk |
@RaeesBhatti hello! Thanks for your effort on this, but it doesn't actually fix the problem for me. I'm on 2.36 which includes this change, but console.log still does nothing. |
@unclejustin Can you please post a sample function to reproduce this issue! |
Certainly. Also note that I can put the const { retry, respondSuccess, respondError } = require('./utils')
const stripe = require('stripe')(process.env.STRIPE_SK)
const baseUrl = process.env.BASE_URL
exports.handler = (event, context, callback) => {
console.log('Please work bby')
switch (event.httpMethod) {
// Code...
}
} |
It was yarn! @RaeesBhatti 🙇 Ran I'm all good, thanks for straightening me out 💪 |
No problem. Glad we could figure this out! 🎉 |
- Summary
Fixes
console.log
s not working in latest version when running Netlify Functions withnetlify dev
.Fixes: #716
- Test plan
console.log
to your Netlify Function and run it throughnetlify dev
- Description for the changelog
Use
winston
to provide custom logger forlambda-local
- A picture of a cute animal (not mandatory but encouraged)
🐥