Skip to content
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

Consider adding connexion support #18

Closed
donbowman opened this issue Mar 13, 2019 · 2 comments · Fixed by #21
Closed

Consider adding connexion support #18

donbowman opened this issue Mar 13, 2019 · 2 comments · Fixed by #21

Comments

@donbowman
Copy link
Contributor

spec-first/connexion#640 shows that its a pain for people to create json logging w/ connexion.

but its essentially flask i think.

@bobbui
Copy link
Owner

bobbui commented Mar 13, 2019

@donbowman PR welcome. currently, I'm super busy so not really looking to implement any new feature except bug fixing. Take a look here on how to add support for new framework:
https://github.com/thangbn/json-logging-python#5-framework-support-plugin-development
thanks

@bhechinger
Copy link

So just treating it like flask seems to work for me, however I'm not able to customize the output.

app = connexion.App(__name__, specification_dir='./')

# Read the swagger.yml file to configure the endpoints
app.add_api('AuthServer.yaml')

application = app.app
application.logger.setLevel(logging.DEBUG)
json_logging.ENABLE_JSON_LOGGING = True
json_logging.init(framework_name='flask')
json_logging.init_request_instrument(application)

If I change the init to:

json_logging.init(framework_name='flask', custom_formatter=CustomJSONLog)

Using your example custom format it seems like that gets ignored.

donbowman added a commit to donbowman/json-logging-python that referenced this issue May 19, 2019
Resolves [bobbui#18](bobbui#18)

[Connexion](https://github.com/zalando/connexion) is a Flask-derived
OpenAPI framework.
donbowman added a commit to donbowman/json-logging-python that referenced this issue May 20, 2019
Resolves [bobbui#18](bobbui#18)

[Connexion](https://github.com/zalando/connexion) is a Flask-derived
OpenAPI framework.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants