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

Guide on customizing prediction/feedback log logger config #1058

Closed
parano opened this issue Sep 3, 2020 · 7 comments
Closed

Guide on customizing prediction/feedback log logger config #1058

parano opened this issue Sep 3, 2020 · 7 comments
Labels
documentation Documentation, tutorials, and example projects

Comments

@parano
Copy link
Member

parano commented Sep 3, 2020

Is your feature request related to a problem? Please describe.

Currently, the bentoml logging config is mostly defined here: https://github.com/bentoml/BentoML/blob/v0.8.6/bentoml/utils/log.py

It is a good default logging config but users may want to further configure it. Especially around configuring the prediction and feedback logs.

Users can already do this via the Python logging library today. e.g.

import logging
bentoml_prediction_logger = logging.getLogger('bentoml.prediction')
bentoml_prediction_logger.addHandler(my_custom_log_handler)

We should add a guide on how best practices around customizing and managing the prediction logs, as well as ways a user can set up log collection sidecar, etc

@parano parano changed the title Support customizing prediction/feedback log logger config Guide on customizing prediction/feedback log logger config Sep 3, 2020
@parano parano added the documentation Documentation, tutorials, and example projects label Sep 3, 2020
@bojiang bojiang self-assigned this Sep 8, 2020
@mikedewar
Copy link

being able to manage the logging using the cli would be very helpful - we're running into a problem when we don't have write access to the local disk and it would be very handy to have all the loggers just have console handlers. It's not entirely clear how to override this from the command line.

@parano
Copy link
Member Author

parano commented Oct 26, 2020

Hi @mikedewar - unfortunately, there isn't a way to configure that behavior in the current version of BentoML. This has been reported by quite a few users recently and it is being tracked here: #1009 It should be a fairly small code change and I will prioritize it for the next release. Thank you for reporting it!

@mikedewar
Copy link

ah I should have dug a little deeper before commenting! I appreciate the prioritisation. 🙏

@parano
Copy link
Member Author

parano commented Oct 26, 2020

@mikedewar actually found a quick workaround for you without waiting for the next release. You can try adding the following line in your BentoService class definition file, after importing BentoML:

import logging
bentoml_file_handler = next(handler for handler in logging.getLogger('bentoml').handlers if type(handler) is logging.handlers.RotatingFileHandler)
logging.getLogger('bentoml').removeHandler(bentoml_file_handler)

We should be able to make this more easily configurable in the next release 🙏

@mikedewar
Copy link

@parano thanks for this. We're actually stuck where we're using the CLI tool e.g. bentoml serve-gunicorn ... and it's crashing in our deployment env as it can't write to the local disk. We'll figure out something to let us keep moving in the short term, and look forward to the new feature in the next release!

@stale
Copy link

stale bot commented Feb 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 2, 2021
@yubozhao yubozhao removed the stale label Feb 2, 2021
@parano parano closed this as completed Feb 2, 2021
@parano
Copy link
Member Author

parano commented Feb 2, 2021

This has been added by @ssheng here: https://docs.bentoml.org/en/latest/guides/logging.html

@bojiang bojiang removed their assignment Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation, tutorials, and example projects
Projects
None yet
Development

No branches or pull requests

4 participants