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: Improve logging format and configurability #2298

Merged
merged 2 commits into from
Feb 23, 2022
Merged

Conversation

ssheng
Copy link
Collaborator

@ssheng ssheng commented Feb 22, 2022

Description

Improve service and access logging format and configurability.

  • Standardize log timestamp to using ISO_8601 standards, e.g. 02/21/2022T23:39:34.
  • Repeat timestamp in log entries even though they were generated from the same second.
  • Fix a bug in producing excessive access logs in streaming mode.
  • Restructure configuration and separate logging configuration for api_server and runners.
  • Updated the sampled key value pair to logging 0 or 1 instead of False or True.

Motivation and Context

How Has This Been Tested?

Checklist:

  • My code follows the bentoml code style, both make format and
    make lint script have passed
    (instructions).
  • My change reduces project test coverage and requires unit tests to be added
  • I have added unit tests covering my code change
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #2298 (c1a6bba) into main (9029c1f) will decrease coverage by 0.05%.
The diff coverage is 23.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2298      +/-   ##
==========================================
- Coverage   47.64%   47.59%   -0.06%     
==========================================
  Files         105      105              
  Lines        8196     8205       +9     
==========================================
  Hits         3905     3905              
- Misses       4291     4300       +9     
Impacted Files Coverage Δ
bentoml/_internal/server/access.py 0.00% <0.00%> (ø)
bentoml/_internal/server/runner_app.py 0.00% <0.00%> (ø)
bentoml/_internal/server/service_app.py 0.00% <0.00%> (ø)
bentoml/_internal/configuration/containers.py 62.41% <100.00%> (ø)
bentoml/_internal/log.py 96.66% <100.00%> (ø)
bentoml/_internal/trace.py 90.62% <100.00%> (ø)
bentoml/_internal/server/base_app.py 0.00% <0.00%> (ø)
bentoml/_internal/server/instruments.py 0.00% <0.00%> (ø)

@parano parano self-requested a review February 23, 2022 08:28
Copy link
Member

@parano parano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

middlewares.append(
Middleware(
AccessLogMiddleware,
has_request_content_length=access_log_config.request_content_length.get(),
Copy link
Member

@parano parano Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: renaming has_ to log_? e.g. from has_request_content_length to log_request_content_length

feel free to do that in future logging related PR if you think that makes sense, merging now!

@parano parano merged commit cf90722 into bentoml:main Feb 23, 2022
aarnphm pushed a commit to aarnphm/BentoML that referenced this pull request Feb 23, 2022
* Fix logging related issues.

* Add access logging configuraiton.

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@ssheng ssheng deleted the logging branch May 19, 2022 06:07
aarnphm pushed a commit to aarnphm/BentoML that referenced this pull request Jul 29, 2022
* Fix logging related issues.

* Add access logging configuraiton.
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.

None yet

2 participants