forked from bentoml/BentoML
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Allow full logging customization through YAML configura… (
bentoml#1365) * [Enhancement] Allow full logging customization through YAML configuration (bentoml#1009) * Add yaml to install_requires in setup.py * Use ruamel.yaml instead of yaml for parsing logging configuration and remove local file handlers for prediction and feedback loggers * Address linter errors and update documentation. * Addressed pull request comments. - Added configuration for disabling console and file logging - Added unit test for log.py - Added documentation for configuration in general - Updated documentation for logging * Added debug logging to specify where logging configuration was loaded from. * Fix unit test file permission issue on Windows. * Update documentation log file examples.
- Loading branch information
Showing
6 changed files
with
450 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.. _configuration-page: | ||
|
||
Configuration | ||
============= | ||
|
||
BentoML can be configured through configuration properties defined in the `default_bentoml.cfg <https://github.com/bentoml/BentoML/blob/master/bentoml/configuration/default_bentoml.cfg>`_. | ||
The values of configuration properties are applied in the following precedence order. | ||
|
||
- Environment Variables | ||
- User Defined Configuration File | ||
- BentoML Defaults | ||
|
||
Environment Variables | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
To override a configuration property, environment variables should be named in the following convention, | ||
`BENTOML__<SECTION>__<KEY>`, in upper case letters. | ||
|
||
For example, to override the `level` property to `ERROR` in the `logging` section of the configuration, user | ||
should define an environment variable named `BENTOML__LOGGING__LEVEL` with value `ERROR`. | ||
|
||
|
||
.. code-block:: cfg | ||
:caption: default_bentoml.cfg | ||
[logging] | ||
level = INFO | ||
See Docker example below for setting the environment variable of logging level. | ||
|
||
.. code-block:: shell | ||
$ docker run -e BENTOML__LOGGING__LEVEL=ERROR | ||
User Defined Configuration File | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
A user defined configuration file, in the same format as the | ||
`default_bentoml.cfg <https://github.com/bentoml/BentoML/blob/master/bentoml/configuration/default_bentoml.cfg>`_ | ||
can be placed under the BentoML home directory with the file name `bentoml.cfg`, to override existing configuration | ||
properties. | ||
|
||
The example below, overrides both `level` and `file_logging_enabled` properties in the `logging` section, to change | ||
logging level to `WARN` and disable file based logging. | ||
|
||
.. code-block:: cfg | ||
:caption: {BENTOML_HOME}/bentoml.cfg | ||
[logging] | ||
level = WARN | ||
file_logging_enabled = false | ||
See Docker example below for injecting the BentoML configuration file into the container. | ||
|
||
.. code-block:: shell | ||
$ docker run -v /local/path/to/bentoml.cfg:{BENTOML_HOME}/bentoml.cfg | ||
BentoML Defaults | ||
^^^^^^^^^^^^^^^^ | ||
|
||
Any non-overridden properties will fallback to the default values defined in | ||
`default_bentoml.cfg <https://github.com/bentoml/BentoML/blob/master/bentoml/configuration/default_bentoml.cfg>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.