Specify log level on Netlify functions?

In the functions docs, there is a reference to logging out via console.log. We have the practice of leaving debug log statements in for finicky services that may be hard to trace, so we can quickly toggle them on for troubleshooting and off for performance. Especially when it comes to a pay-per-use service like Functions, logging adds a lot of overhead, and therefore cost.

Any chance we can get a runtime control over the log level when running functions?

Thanks!

Hi there,

You could certainly have your function log differently based on e.g. a query string parameter that you detect. Since functions are “statically” deployed - they don’t change after deployment - there isn’t a sense of something tunable we can expose, but of course your code can be made smart enough to show what you want when you want :slight_smile: