question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose setting logging configuration per method

See original GitHub issue

This is a Feature Proposal

Description

This may be marked as a duplicate of #1918 but I don’t believe it is a duplicate.

I would like to see the ability to specify logging configuration at the http event level. So something like this:

functions:
  api:
    name: ${self:provider.stage}-api
    handler: wsgi.handler
    environment: ${self:custom.env.environment}
    events:
    - http:
        method: GET
        path: /user/{user_id}
        logging:
          level: INFO
          metrics: true
          dataTraceEnabled: false

Similar or dependent issues:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
pmuenscommented, May 1, 2017

Thanks for the feedback and the description of the use case @briguy202

but could there perhaps be a section within each function block that would allow for platform-specific properties?

Yes, that’s exactly what we’re going to do in the future. We’ll prepend everything with the provider. So e.g. aws-logging.

Generally speaking we’re looking at issues where we got the most feedback and which provide the most value for the largest chunk of users. It’s always the problem of great, new functionality vs. adding technical debt.

However there’s always the possibility to write a plugin which supports the requested functionality. Sometimes in the past we’ve migrated the plugin codebase into core after seeing a widespread adoption and need for the plugin.

1reaction
HyperBraincommented, Jun 20, 2017

I will add this feature (including all other possible stage configurations like throttling, caching, etc.) to the alias plugin. See https://github.com/HyperBrain/serverless-aws-alias/issues/57. Even if you do not make use of aliased deployments, you can benefit from the feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

logging.config — Logging configuration — Python 3.11.1 ...
The schema describes a set of logging objects - loggers, handlers, formatters, filters - which are connected to each other in an object...
Read more >
26. Logging - Spring
Default configurations are provided for Java Util Logging, Log4J2, and Logback. In each case, loggers are pre-configured to use console output with optional ......
Read more >
Configure the Logging agent | Google Cloud
When set to prometheus , the Logging agent exposes metrics in Prometheus format on the Prometheus endpoint ( localhost:24231/metrics by default; ...
Read more >
Changing the Logging Level at the Runtime for a Spring Boot ...
In this tutorial, we're going to look at ways we can change the logging level of a Spring Boot application at runtime. As...
Read more >
Python Logging Guide - Best Practices and Hands-on Examples
A logger processes a log request if the numeric value of the requested logging level is greater than or equal to the numeric...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found