vllm.logger
¶
Logging configuration for vLLM.
Functions:
-
configure_logging–Apply a logging configuration in the current process.
-
configure_logging_from_args–Apply parsed logging arguments and retain them for child processes.
-
configure_logging_if_needed–Apply a logging configuration unless it is already active in this process.
-
enable_trace_function_call–Enable tracing of every function call in code under
root_dir. -
init_logger–Retrieve a logger and add vLLM's convenience logging methods.
-
set_vllm_process_name–Set the vLLM process name added to subsequent log records.
_VllmLogRecordFactory
¶
Add vLLM process metadata while preserving the wrapped record factory.
Source code in vllm/logger.py
_VllmLogger
¶
Bases: Logger
Note:
This class is just to provide type information.
We actually patch the methods directly on the logging.Logger
instance to avoid conflicting with other libraries such as
intel_extension_for_pytorch.utils._logger.
Methods:
-
debug_once–As
debug, but subsequent calls with -
error_once–As
error, but subsequent calls with -
info_once–As
info, but subsequent calls with -
warning_once–As
warning, but subsequent calls with
Source code in vllm/logger.py
debug_once(msg, *args, scope='local')
¶
As debug, but subsequent calls with
the same message are silently dropped.
Source code in vllm/logger.py
error_once(msg, *args, scope='local')
¶
As error, but subsequent calls with
the same message are silently dropped.
Source code in vllm/logger.py
info_once(msg, *args, scope='local')
¶
As info, but subsequent calls with
the same message are silently dropped.
Source code in vllm/logger.py
_configure_vllm_root_logger(config=None)
¶
Configure logging from explicit config or bootstrap environment values.
Source code in vllm/logger.py
_log_platform_warnings(config)
¶
Emit platform diagnostics only after an enabled config is active.
Source code in vllm/logger.py
_should_log_with_scope(scope)
¶
Decide whether to log based on scope.
Source code in vllm/logger.py
configure_logging(config)
¶
Apply a logging configuration in the current process.
Source code in vllm/logger.py
configure_logging_from_args(args)
¶
Apply parsed logging arguments and retain them for child processes.
Source code in vllm/logger.py
configure_logging_if_needed(config)
¶
Apply a logging configuration unless it is already active in this process.
enable_trace_function_call(log_file_path, root_dir=None)
¶
Enable tracing of every function call in code under root_dir.
This is useful for debugging hangs or crashes.
log_file_path is the path to the log file.
root_dir is the root directory of the code to trace. If None, it is the
vllm root directory.
Note that this call is thread-level, any threads calling this function will have the trace enabled. Other threads will not be affected.
Source code in vllm/logger.py
init_logger(name)
¶
Retrieve a logger and add vLLM's convenience logging methods.
Source code in vllm/logger.py
set_vllm_process_name(process_name, *, skip_if_set=False)
¶
Set the vLLM process name added to subsequent log records.