Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
4a71926d
Unverified
Commit
4a71926d
authored
Feb 25, 2026
by
Tanmay Verma
Committed by
GitHub
Feb 25, 2026
Browse files
chore: Decouple TLLM_LOG_LEVEL with DYN_LOG (#6606)
parent
06fc5d5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
54 deletions
+1
-54
components/src/dynamo/trtllm/main.py
components/src/dynamo/trtllm/main.py
+1
-13
components/src/dynamo/vllm/tests/test_vllm_logging.py
components/src/dynamo/vllm/tests/test_vllm_logging.py
+0
-2
lib/bindings/python/src/dynamo/runtime/logging.py
lib/bindings/python/src/dynamo/runtime/logging.py
+0
-39
No files found.
components/src/dynamo/trtllm/main.py
View file @
4a71926d
...
...
@@ -3,19 +3,7 @@
import
asyncio
import
logging
import
os
# Configure TLLM_LOG_LEVEL before importing tensorrt_llm
# This must happen before any tensorrt_llm imports
if
"TLLM_LOG_LEVEL"
not
in
os
.
environ
and
os
.
getenv
(
"DYN_SKIP_TRTLLM_LOG_FORMATTING"
)
not
in
(
"1"
,
"true"
,
"TRUE"
):
# This import is safe because it doesn't trigger tensorrt_llm imports
from
dynamo.runtime.logging
import
map_dyn_log_to_tllm_level
dyn_log
=
os
.
environ
.
get
(
"DYN_LOG"
,
"info"
)
tllm_level
=
map_dyn_log_to_tllm_level
(
dyn_log
)
os
.
environ
[
"TLLM_LOG_LEVEL"
]
=
tllm_level
import
uvloop
from
dynamo.common.utils.graceful_shutdown
import
install_signal_handlers
...
...
components/src/dynamo/vllm/tests/test_vllm_logging.py
View file @
4a71926d
...
...
@@ -49,9 +49,7 @@ def _clean_env(monkeypatch):
"VLLM_CONFIGURE_LOGGING"
,
"VLLM_LOGGING_CONFIG_PATH"
,
"DYN_SKIP_SGLANG_LOG_FORMATTING"
,
"DYN_SKIP_TRTLLM_LOG_FORMATTING"
,
"SGLANG_LOGGING_CONFIG_PATH"
,
"TLLM_LOG_LEVEL"
,
]:
monkeypatch
.
delenv
(
var
,
raising
=
False
)
...
...
lib/bindings/python/src/dynamo/runtime/logging.py
View file @
4a71926d
...
...
@@ -149,8 +149,6 @@ def configure_dynamo_logging(
configure_vllm_logging
(
dyn_level
)
if
not
get_bool_env_var
(
"DYN_SKIP_SGLANG_LOG_FORMATTING"
):
configure_sglang_logging
(
dyn_level
)
if
not
get_bool_env_var
(
"DYN_SKIP_TRTLLM_LOG_FORMATTING"
):
configure_trtllm_logging
(
dyn_level
)
# loggers that should be configured to ERROR
error_loggers
=
[
"tag"
]
...
...
@@ -272,43 +270,6 @@ def configure_vllm_logging(dyn_level: int):
async_llm_logger
.
addFilter
(
_HealthCheckFilter
())
def
map_dyn_log_to_tllm_level
(
dyn_log_value
:
str
)
->
str
:
"""
Map DYN_LOG string value to TensorRT-LLM log level.
Args:
dyn_log_value: The DYN_LOG environment variable value (e.g., "debug", "info,module::path=trace")
Returns:
The corresponding TLLM_LOG_LEVEL value (e.g., "VERBOSE", "INFO")
"""
# Extract the base level (handle cases like "debug,module::path=trace")
base_level
=
dyn_log_value
.
lower
().
split
(
","
)[
0
].
strip
()
# Map DYN_LOG levels to TLLM_LOG_LEVEL
level_mapping
=
{
"debug"
:
"DEBUG"
,
"info"
:
"INFO"
,
"warn"
:
"WARNING"
,
"warning"
:
"WARNING"
,
"error"
:
"ERROR"
,
"critical"
:
"ERROR"
,
"trace"
:
"TRACE"
,
}
return
level_mapping
.
get
(
base_level
,
"INFO"
)
def
configure_trtllm_logging
(
dyn_level
:
int
):
# Only set TLLM_LOG_LEVEL if it's not already set
# This allows users to override it explicitly if needed
if
"TLLM_LOG_LEVEL"
not
in
os
.
environ
:
dyn_level_name
=
logging
.
getLevelName
(
dyn_level
)
tllm_level
=
map_dyn_log_to_tllm_level
(
dyn_level_name
)
os
.
environ
[
"TLLM_LOG_LEVEL"
]
=
tllm_level
logging
.
debug
(
f
"Set TLLM_LOG_LEVEL to
{
tllm_level
}
based on DYN_LOG"
)
def
get_bool_env_var
(
name
:
str
,
default
:
str
=
"false"
)
->
bool
:
value
=
os
.
getenv
(
name
,
default
)
value
=
value
.
lower
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment