Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Flask example? #11

Open
thegagne opened this issue Jul 4, 2020 · 2 comments
Open

Flask example? #11

thegagne opened this issue Jul 4, 2020 · 2 comments

Comments

@thegagne
Copy link

thegagne commented Jul 4, 2020

It would be great to have an example that works with flask.

@Divyadarshee
Copy link

Divyadarshee commented Jul 9, 2021

@thegagne did you get a chance to successfully use this for the flask framework?

@rdifrango
Copy link
Contributor

Here's how I integrated it into Flask, it's simply adding the handler to app.logger which Flask exposes:

# Add an ECS formatter to the Handler
handler = logging.StreamHandler()
handler.setFormatter(ecs_logging.StdlibFormatter())
app.logger.addHandler(handler)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants