Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 984455c

Browse files
mseth10matherit
authored andcommitted
expose gunicorn logging (#219)
1 parent 6e99c4c commit 984455c

File tree

1 file changed

+3
-1
lines changed
  • docker/build_artifacts/sagemaker

1 file changed

+3
-1
lines changed

docker/build_artifacts/sagemaker/serve.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self):
5151
self._sagemaker_port_range = os.environ.get("SAGEMAKER_SAFE_PORT_RANGE", None)
5252
self._gunicorn_workers = os.environ.get("SAGEMAKER_GUNICORN_WORKERS", 1)
5353
self._gunicorn_threads = os.environ.get("SAGEMAKER_GUNICORN_THREADS", 1)
54+
self._gunicorn_loglevel = os.environ.get("SAGEMAKER_GUNICORN_LOGLEVEL", "info")
5455
self._tfs_config_path = "/sagemaker/model-config.cfg"
5556
self._tfs_batching_config_path = "/sagemaker/batching-config.cfg"
5657

@@ -204,7 +205,7 @@ def _setup_gunicorn(self):
204205

205206
gunicorn_command = (
206207
"gunicorn -b unix:/tmp/gunicorn.sock -k {} --chdir /sagemaker "
207-
"--workers {} --threads {} "
208+
"--workers {} --threads {} --log-level {} "
208209
"{}{} -e TFS_GRPC_PORTS={} -e TFS_REST_PORTS={} "
209210
"-e SAGEMAKER_MULTI_MODEL={} -e SAGEMAKER_SAFE_PORT_RANGE={} "
210211
"-e SAGEMAKER_TFS_WAIT_TIME_SECONDS={} "
@@ -213,6 +214,7 @@ def _setup_gunicorn(self):
213214
self._gunicorn_worker_class,
214215
self._gunicorn_workers,
215216
self._gunicorn_threads,
217+
self._gunicorn_loglevel,
216218
python_path_option,
217219
",".join(python_path_content),
218220
self._tfs_grpc_concat_ports,

0 commit comments

Comments
 (0)