From a62ec2d15f83f7e702b1f663ee7018c93c4a3d38 Mon Sep 17 00:00:00 2001 From: Lukas <52111220+gardberg@users.noreply.github.com> Date: Mon, 5 Feb 2024 23:26:50 +0100 Subject: [PATCH] Set local logging level via env variable (#2774) --- vllm/logger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/logger.py b/vllm/logger.py index 24d4f0ec1ae0a..530494ae66925 100644 --- a/vllm/logger.py +++ b/vllm/logger.py @@ -3,6 +3,7 @@ """Logging configuration for vLLM.""" import logging import sys +import os _FORMAT = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d] %(message)s" _DATE_FORMAT = "%m-%d %H:%M:%S" @@ -50,7 +51,7 @@ def _setup_logger(): def init_logger(name: str): # Use the same settings as above for root logger logger = logging.getLogger(name) - logger.setLevel(logging.DEBUG) + logger.setLevel(os.getenv("LOG_LEVEL", "DEBUG")) logger.addHandler(_default_handler) logger.propagate = False return logger