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

feat: update request/reponse logging, disable sanic access log #370

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

edaniszewski
Copy link
Contributor

This PR:

  • disables the sanic access log, as it doesn't format messages well for structlog
  • moves the existing request logging to app middleware
  • adds response logging

Example logs of this new setup:

timestamp='2020-03-02T14:36:46.096092Z' logger='synse_server.app' level='debug' event='processing HTTP request' request_id='ZEXhnBYZr74w67mRgTXmxj' method='GET' ip='192.168.112.1' path='/test' headers={'host': 'localhost:5000', 'user-agent': 'curl/7.64.1', 'accept': '*/*'} args={}
timestamp='2020-03-02T14:36:46.096360Z' logger='synse_server.cmd.test' level='info' event='issuing command' request_id='ZEXhnBYZr74w67mRgTXmxj' command='TEST'
timestamp='2020-03-02T14:36:46.096907Z' logger='synse_server.app' level='debug' event='returning HTTP response' request_id='ZEXhnBYZr74w67mRgTXmxj' request='GET http://localhost:5000/test' status=200 bytes=58

@edaniszewski edaniszewski merged commit 5587fa0 into v3/staging Mar 2, 2020
@edaniszewski edaniszewski deleted the v3/req-logging branch March 2, 2020 15:37
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 this pull request may close these issues.

3 participants